1 ; RUN: opt -inline -S < %s | FileCheck %s
2 ; RUN: opt -passes='cgscc(inline)' -S < %s | FileCheck %s
4 define dso_local i32 @main() #0 {
5 %1 = alloca i32, align 4
6 store i32 0, i32* %1, align 4
7 %2 = call i32 @t32(i32 0)
11 define internal i32 @t32(i32) #0 {
12 %2 = alloca i32, align 4
13 %3 = alloca i32, align 4
14 store i32 %0, i32* %3, align 4
15 %4 = load i32, i32* %3, align 4
16 callbr void asm sideeffect "testl $0, $0; jne ${1:l};", "r,X,X,~{dirflag},~{fpsr},~{flags}"(i32 %4, i8* blockaddress(@t32, %7), i8* blockaddress(@t32, %6)) #1
17 to label %5 [label %7, label %6]
19 ; <label>:5: ; preds = %1
20 store i32 0, i32* %2, align 4
23 ; <label>:6: ; preds = %1
24 store i32 1, i32* %2, align 4
27 ; <label>:7: ; preds = %1
28 store i32 2, i32* %2, align 4
31 ; <label>:8: ; preds = %7, %6, %5
32 %9 = load i32, i32* %2, align 4
36 ; Check that @t32 no longer exists after inlining, as it has now been inlined
40 ; CHECK: define dso_local i32 @main
41 ; CHECK: callbr void asm sideeffect "testl $0, $0; jne ${1:l};", "r,X,X,~{dirflag},~{fpsr},~{flags}"(i32 %6, i8* blockaddress(@main, %9), i8* blockaddress(@main, %8))
42 ; CHECK: to label %7 [label %9, label %8]
44 ; CHECK-NEXT: store i32 0, i32* %1, align 4
45 ; CHECK-NEXT: br label %t32.exit
47 ; CHECK-NEXT: store i32 1, i32* %1, align 4
48 ; CHECK-NEXT: br label %t32.exit
50 ; CHECK-NEXT: store i32 2, i32* %1, align 4
51 ; CHECK-NEXT: br label %t32.exit
53 ; CHECK-NEXT: %10 = load i32, i32* %1, align 4