xref: /llvm-project/llvm/test/CodeGen/AArch64/swift-error-unreachable-use.ll (revision f6947e479e14e7904aa0b2539a95f5dfdc8f9295)
1; RUN: llc -mtriple aarch64-unknown-windows-msvc %s -filetype asm -o - | FileCheck %s
2; RUN: llc -mtriple aarch64-unknown-linux-gnu %s -filetype asm -o - | FileCheck %s
3; RUN: llc -mtriple aarch64-apple-macosx %s -filetype asm -o - | FileCheck %s
4; Regression test for https://github.com/llvm/llvm-project/issues/59751
5
6define void @"func"(ptr swifterror %0) #0 {
7; CHECK-LABEL: func:
8; CHECK:       {{.*}}%bb.0:
9; CHECK-NEXT:    b {{\.?}}LBB0_2
10; CHECK-NEXT:  {{\.?}}LBB0_1:{{.*}}%thirtythree
11; CHECK-NEXT:  {{.*}}=>This Inner Loop Header: Depth=1
12; CHECK-NEXT:    b {{\.?}}LBB0_1
13; CHECK-NEXT:  {{\.?}}LBB0_2:{{.*}}%thirtyeight
14; CHECK-NEXT:    b {{\.?}}LBB0_3
15; CHECK-NEXT:  {{\.?}}LBB0_3:{{.*}}%thirtythree.preheader
16; CHECK-NEXT:    b {{\.?}}LBB0_1
17  br label %thirtyeight
18
19five:
20  br label %UelOc2l.exit
21
22common.ret:
23  ret void
24
25UelOc2l.exit:
26  %a = getelementptr inbounds [754 x ptr], ptr undef, i32 undef, i32 undef
27  %b = load ptr, ptr %a, align 8
28  %c = bitcast ptr %b to ptr
29  call void %c()
30  br label %common.ret
31
32thirtythree:
33  br i1 false, label %UelOc2l.exit, label %thirtythree
34
35thirtyeight:
36  br i1 undef, label %thirtyeight, label %thirtythree
37}
38
39attributes #0 = { noinline optnone }
40