1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=inline -S < %s | FileCheck %s
3 ; RUN: opt -passes='cgscc(inline)' -S < %s | FileCheck %s
4 ; RUN: opt -passes='module-inline' -S < %s | FileCheck %s
6 define dso_local i32 @main() {
9 ; CHECK-NEXT: [[I_I:%.*]] = alloca i32, align 4
10 ; CHECK-NEXT: [[I1_I:%.*]] = alloca i32, align 4
11 ; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
12 ; CHECK-NEXT: store i32 0, ptr [[I]], align 4
13 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I_I]])
14 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I1_I]])
15 ; CHECK-NEXT: store i32 0, ptr [[I1_I]], align 4
16 ; CHECK-NEXT: [[I2_I:%.*]] = load i32, ptr [[I1_I]], align 4
17 ; CHECK-NEXT: callbr void asm sideeffect "", "r,!i,!i,~{dirflag},~{fpsr},~{flags}"(i32 [[I2_I]])
18 ; CHECK-NEXT: to label [[BB3_I:%.*]] [label [[BB5_I:%.*]], label %bb4.i]
20 ; CHECK-NEXT: store i32 0, ptr [[I_I]], align 4
21 ; CHECK-NEXT: br label [[T32_EXIT:%.*]]
23 ; CHECK-NEXT: store i32 1, ptr [[I_I]], align 4
24 ; CHECK-NEXT: br label [[T32_EXIT]]
26 ; CHECK-NEXT: store i32 2, ptr [[I_I]], align 4
27 ; CHECK-NEXT: br label [[T32_EXIT]]
29 ; CHECK-NEXT: [[I7_I:%.*]] = load i32, ptr [[I_I]], align 4
30 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr [[I_I]])
31 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr [[I1_I]])
32 ; CHECK-NEXT: ret i32 [[I7_I]]
35 %i = alloca i32, align 4
36 store i32 0, ptr %i, align 4
37 %i1 = call i32 @t32(i32 0)
41 define internal i32 @t32(i32 %arg) {
43 %i = alloca i32, align 4
44 %i1 = alloca i32, align 4
45 store i32 %arg, ptr %i1, align 4
46 %i2 = load i32, ptr %i1, align 4
47 callbr void asm sideeffect "", "r,!i,!i,~{dirflag},~{fpsr},~{flags}"(i32 %i2)
48 to label %bb3 [label %bb5, label %bb4]
51 store i32 0, ptr %i, align 4
55 store i32 1, ptr %i, align 4
59 store i32 2, ptr %i, align 4
62 bb6: ; preds = %bb5, %bb4, %bb3
63 %i7 = load i32, ptr %i, align 4