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
30 %and1 = and i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), 4294967296
31 %cmp1 = icmp eq i64 %and1, 0
32 br i1 %cmp1, label %_Z3fooiM1BFvvE.exit, label %cond_true.i
35 %ctg23.i = getelementptr i8, ptr %b.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
36 %tmp15.i = load ptr, ptr %ctg23.i
37 %ctg2.i = getelementptr i8, ptr %tmp15.i, i32 ptrtoint (ptr @_ZN1B1iEv to i32)
38 %tmp22.i = load ptr, ptr %ctg2.i
39 br label %_Z3fooiM1BFvvE.exit
42 %iftmp.2.0.i = phi ptr [ %tmp22.i, %cond_true.i ], [ inttoptr (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to ptr), %entry ]
43 %ctg25.i = getelementptr i8, ptr %b.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
44 call void %iftmp.2.0.i(ptr %ctg25.i)
45 store i32 6, ptr %b.i29
46 %and2 = and i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), 4294967296
47 %cmp2 = icmp eq i64 %and2, 0
48 br i1 %cmp2, label %_Z3fooiM1BFvvE.exit56, label %cond_true.i46
51 %ctg23.i36 = getelementptr i8, ptr %b.i29, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)
52 %tmp15.i38 = load ptr, ptr %ctg23.i36
53 %ctg2.i42 = getelementptr i8, ptr %tmp15.i38, i32 ptrtoint (ptr @_ZN1B1jEv to i32)
54 %tmp22.i44 = load ptr, ptr %ctg2.i42
55 br label %_Z3fooiM1BFvvE.exit56
57 _Z3fooiM1BFvvE.exit56:
58 %iftmp.2.0.i49 = phi ptr [ %tmp22.i44, %cond_true.i46 ], [ inttoptr (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to ptr), %_Z3fooiM1BFvvE.exit ]
59 %ctg25.i54 = getelementptr i8, ptr %b.i29, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)
60 call void %iftmp.2.0.i49(ptr %ctg25.i54)
61 store i32 -1, ptr %b.i1
62 %and3 = and i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), 4294967296
63 %cmp3 = icmp eq i64 %and3, 0
64 br i1 %cmp3, label %_Z3fooiM1BFvvE.exit28, label %cond_true.i18
67 %ctg23.i8 = getelementptr i8, ptr %b.i1, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
68 %tmp15.i10 = load ptr, ptr %ctg23.i8
69 %ctg2.i14 = getelementptr i8, ptr %tmp15.i10, i32 ptrtoint (ptr @_ZN1B1iEv to i32)
70 %tmp22.i16 = load ptr, ptr %ctg2.i14
71 br label %_Z3fooiM1BFvvE.exit28
73 _Z3fooiM1BFvvE.exit28:
74 %iftmp.2.0.i21 = phi ptr [ %tmp22.i16, %cond_true.i18 ], [ inttoptr (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to ptr), %_Z3fooiM1BFvvE.exit56 ]
75 %ctg25.i26 = getelementptr i8, ptr %b.i1, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
76 call void %iftmp.2.0.i21(ptr %ctg25.i26)