1 ; RUN: llc -mtriple arm-apple-darwin -relocation-model pic -filetype asm -o - %s | FileCheck %s
3 %struct.B = type { i32 }
4 %struct.anon = type { ptr, i32 }
5 @str = internal constant [7 x i8] c"i, %d\0A\00"
6 @str1 = internal constant [7 x i8] c"j, %d\0A\00"
8 define internal void @_ZN1B1iEv(ptr %this) {
10 %tmp2 = load i32, ptr %this
11 %tmp4 = tail call i32 (ptr, ...) @printf(ptr @str, i32 %tmp2)
15 declare i32 @printf(ptr, ...)
17 define internal void @_ZN1B1jEv(ptr %this) {
19 %tmp2 = load i32, ptr %this
20 %tmp4 = tail call i32 (ptr, ...) @printf(ptr @str1, i32 %tmp2)
26 %b.i29 = alloca %struct.B, align 4
27 %b.i1 = alloca %struct.B, align 4
28 %b.i = alloca %struct.B, align 4
29 store i32 4, ptr %b.i, align 4
30 %constexpr = ptrtoint ptr @_ZN1B1iEv to i32
31 %constexpr1 = zext i32 %constexpr to i64
32 %and1 = and i64 %constexpr1, 4294967296
33 %cmp1 = icmp eq i64 %and1, 0
34 br i1 %cmp1, label %phi.constexpr, label %cond_true.i
36 cond_true.i: ; preds = %entry
37 %ctg23.i = getelementptr i8, ptr %b.i, i32 0
38 %tmp15.i = load ptr, ptr %ctg23.i, align 8
39 %constexpr2 = ptrtoint ptr @_ZN1B1iEv to i32
40 %ctg2.i = getelementptr i8, ptr %tmp15.i, i32 %constexpr2
41 %tmp22.i = load ptr, ptr %ctg2.i, align 8
42 br label %_Z3fooiM1BFvvE.exit
44 phi.constexpr: ; preds = %entry
45 %constexpr3 = ptrtoint ptr @_ZN1B1iEv to i32
46 %constexpr4 = inttoptr i32 %constexpr3 to ptr
47 br label %_Z3fooiM1BFvvE.exit
49 _Z3fooiM1BFvvE.exit: ; preds = %phi.constexpr, %cond_true.i
50 %iftmp.2.0.i = phi ptr [ %tmp22.i, %cond_true.i ], [ %constexpr4, %phi.constexpr ]
51 %ctg25.i = getelementptr i8, ptr %b.i, i32 0
52 call void %iftmp.2.0.i(ptr %ctg25.i)
53 store i32 6, ptr %b.i29, align 4
54 %constexpr5 = ptrtoint ptr @_ZN1B1iEv to i32
55 %constexpr6 = zext i32 %constexpr5 to i64
56 %and2 = and i64 %constexpr6, 4294967296
57 %cmp2 = icmp eq i64 %and2, 0
58 br i1 %cmp2, label %phi.constexpr8, label %cond_true.i46
60 cond_true.i46: ; preds = %_Z3fooiM1BFvvE.exit
61 %ctg23.i36 = getelementptr i8, ptr %b.i29, i32 0
62 %tmp15.i38 = load ptr, ptr %ctg23.i36, align 8
63 %constexpr7 = ptrtoint ptr @_ZN1B1jEv to i32
64 %ctg2.i42 = getelementptr i8, ptr %tmp15.i38, i32 %constexpr7
65 %tmp22.i44 = load ptr, ptr %ctg2.i42, align 8
66 br label %_Z3fooiM1BFvvE.exit56
68 phi.constexpr8: ; preds = %_Z3fooiM1BFvvE.exit
69 %constexpr9 = ptrtoint ptr @_ZN1B1jEv to i32
70 %constexpr10 = inttoptr i32 %constexpr9 to ptr
71 br label %_Z3fooiM1BFvvE.exit56
73 _Z3fooiM1BFvvE.exit56: ; preds = %phi.constexpr8, %cond_true.i46
74 %iftmp.2.0.i49 = phi ptr [ %tmp22.i44, %cond_true.i46 ], [ %constexpr10, %phi.constexpr8 ]
75 %ctg25.i54 = getelementptr i8, ptr %b.i29, i32 0
76 call void %iftmp.2.0.i49(ptr %ctg25.i54)
77 store i32 -1, ptr %b.i1, align 4
78 %constexpr11 = ptrtoint ptr @_ZN1B1iEv to i32
79 %constexpr12 = zext i32 %constexpr11 to i64
80 %and3 = and i64 %constexpr12, 4294967296
81 %cmp3 = icmp eq i64 %and3, 0
82 br i1 %cmp3, label %phi.constexpr14, label %cond_true.i18
84 cond_true.i18: ; preds = %_Z3fooiM1BFvvE.exit56
85 %ctg23.i8 = getelementptr i8, ptr %b.i1, i32 0
86 %tmp15.i10 = load ptr, ptr %ctg23.i8, align 8
87 %constexpr13 = ptrtoint ptr @_ZN1B1iEv to i32
88 %ctg2.i14 = getelementptr i8, ptr %tmp15.i10, i32 %constexpr13
89 %tmp22.i16 = load ptr, ptr %ctg2.i14, align 8
90 br label %_Z3fooiM1BFvvE.exit28
92 phi.constexpr14: ; preds = %_Z3fooiM1BFvvE.exit56
93 %constexpr15 = ptrtoint ptr @_ZN1B1iEv to i32
94 %constexpr16 = inttoptr i32 %constexpr15 to ptr
95 br label %_Z3fooiM1BFvvE.exit28
97 _Z3fooiM1BFvvE.exit28: ; preds = %phi.constexpr14, %cond_true.i18
98 %iftmp.2.0.i21 = phi ptr [ %tmp22.i16, %cond_true.i18 ], [ %constexpr16, %phi.constexpr14 ]
99 %ctg25.i26 = getelementptr i8, ptr %b.i1, i32 0
100 call void %iftmp.2.0.i21(ptr %ctg25.i26)