xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic | \
2*9880d681SAndroid Build Coastguard Worker; RUN:   not grep LPC9
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker	%struct.B = type { i32 }
5*9880d681SAndroid Build Coastguard Worker	%struct.anon = type { void (%struct.B*)*, i32 }
6*9880d681SAndroid Build Coastguard Worker@str = internal constant [7 x i8] c"i, %d\0A\00"		; <[7 x i8]*> [#uses=1]
7*9880d681SAndroid Build Coastguard Worker@str1 = internal constant [7 x i8] c"j, %d\0A\00"		; <[7 x i8]*> [#uses=1]
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine internal void @_ZN1B1iEv(%struct.B* %this) {
10*9880d681SAndroid Build Coastguard Workerentry:
11*9880d681SAndroid Build Coastguard Worker	%tmp1 = getelementptr %struct.B, %struct.B* %this, i32 0, i32 0		; <i32*> [#uses=1]
12*9880d681SAndroid Build Coastguard Worker	%tmp2 = load i32, i32* %tmp1		; <i32> [#uses=1]
13*9880d681SAndroid Build Coastguard Worker	%tmp4 = tail call i32 (i8*, ...) @printf( i8* getelementptr ([7 x i8], [7 x i8]* @str, i32 0, i32 0), i32 %tmp2 )		; <i32> [#uses=0]
14*9880d681SAndroid Build Coastguard Worker	ret void
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerdeclare i32 @printf(i8*, ...)
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerdefine internal void @_ZN1B1jEv(%struct.B* %this) {
20*9880d681SAndroid Build Coastguard Workerentry:
21*9880d681SAndroid Build Coastguard Worker	%tmp1 = getelementptr %struct.B, %struct.B* %this, i32 0, i32 0		; <i32*> [#uses=1]
22*9880d681SAndroid Build Coastguard Worker	%tmp2 = load i32, i32* %tmp1		; <i32> [#uses=1]
23*9880d681SAndroid Build Coastguard Worker	%tmp4 = tail call i32 (i8*, ...) @printf( i8* getelementptr ([7 x i8], [7 x i8]* @str1, i32 0, i32 0), i32 %tmp2 )		; <i32> [#uses=0]
24*9880d681SAndroid Build Coastguard Worker	ret void
25*9880d681SAndroid Build Coastguard Worker}
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerdefine i32 @main() {
28*9880d681SAndroid Build Coastguard Workerentry:
29*9880d681SAndroid Build Coastguard Worker	%b.i29 = alloca %struct.B, align 4		; <%struct.B*> [#uses=3]
30*9880d681SAndroid Build Coastguard Worker	%b.i1 = alloca %struct.B, align 4		; <%struct.B*> [#uses=3]
31*9880d681SAndroid Build Coastguard Worker	%b.i = alloca %struct.B, align 4		; <%struct.B*> [#uses=3]
32*9880d681SAndroid Build Coastguard Worker	%tmp2.i = getelementptr %struct.B, %struct.B* %b.i, i32 0, i32 0		; <i32*> [#uses=1]
33*9880d681SAndroid Build Coastguard Worker	store i32 4, i32* %tmp2.i
34*9880d681SAndroid Build Coastguard Worker	br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit, label %cond_true.i
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workercond_true.i:		; preds = %entry
37*9880d681SAndroid Build Coastguard Worker	%b2.i = bitcast %struct.B* %b.i to i8*		; <i8*> [#uses=1]
38*9880d681SAndroid Build Coastguard Worker	%ctg23.i = getelementptr i8, i8* %b2.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)		; <i8*> [#uses=1]
39*9880d681SAndroid Build Coastguard Worker	%tmp121314.i = bitcast i8* %ctg23.i to i32 (...)***		; <i32 (...)***> [#uses=1]
40*9880d681SAndroid Build Coastguard Worker	%tmp15.i = load i32 (...)**, i32 (...)*** %tmp121314.i		; <i32 (...)**> [#uses=1]
41*9880d681SAndroid Build Coastguard Worker	%tmp151.i = bitcast i32 (...)** %tmp15.i to i8*		; <i8*> [#uses=1]
42*9880d681SAndroid Build Coastguard Worker	%ctg2.i = getelementptr i8, i8* %tmp151.i, i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32)		; <i8*> [#uses=1]
43*9880d681SAndroid Build Coastguard Worker	%tmp2021.i = bitcast i8* %ctg2.i to i32 (...)**		; <i32 (...)**> [#uses=1]
44*9880d681SAndroid Build Coastguard Worker	%tmp22.i = load i32 (...)*, i32 (...)** %tmp2021.i		; <i32 (...)*> [#uses=1]
45*9880d681SAndroid Build Coastguard Worker	%tmp2223.i = bitcast i32 (...)* %tmp22.i to void (%struct.B*)*		; <void (%struct.B*)*> [#uses=1]
46*9880d681SAndroid Build Coastguard Worker	br label %_Z3fooiM1BFvvE.exit
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard Worker_Z3fooiM1BFvvE.exit:		; preds = %cond_true.i, %entry
49*9880d681SAndroid Build Coastguard Worker	%iftmp.2.0.i = phi void (%struct.B*)* [ %tmp2223.i, %cond_true.i ], [ inttoptr (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to void (%struct.B*)*), %entry ]		; <void (%struct.B*)*> [#uses=1]
50*9880d681SAndroid Build Coastguard Worker	%b4.i = bitcast %struct.B* %b.i to i8*		; <i8*> [#uses=1]
51*9880d681SAndroid Build Coastguard Worker	%ctg25.i = getelementptr i8, i8* %b4.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)		; <i8*> [#uses=1]
52*9880d681SAndroid Build Coastguard Worker	%tmp3031.i = bitcast i8* %ctg25.i to %struct.B*		; <%struct.B*> [#uses=1]
53*9880d681SAndroid Build Coastguard Worker	call void %iftmp.2.0.i( %struct.B* %tmp3031.i )
54*9880d681SAndroid Build Coastguard Worker	%tmp2.i30 = getelementptr %struct.B, %struct.B* %b.i29, i32 0, i32 0		; <i32*> [#uses=1]
55*9880d681SAndroid Build Coastguard Worker	store i32 6, i32* %tmp2.i30
56*9880d681SAndroid Build Coastguard Worker	br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit56, label %cond_true.i46
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Workercond_true.i46:		; preds = %_Z3fooiM1BFvvE.exit
59*9880d681SAndroid Build Coastguard Worker	%b2.i35 = bitcast %struct.B* %b.i29 to i8*		; <i8*> [#uses=1]
60*9880d681SAndroid Build Coastguard Worker	%ctg23.i36 = getelementptr i8, i8* %b2.i35, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)		; <i8*> [#uses=1]
61*9880d681SAndroid Build Coastguard Worker	%tmp121314.i37 = bitcast i8* %ctg23.i36 to i32 (...)***		; <i32 (...)***> [#uses=1]
62*9880d681SAndroid Build Coastguard Worker	%tmp15.i38 = load i32 (...)**, i32 (...)*** %tmp121314.i37		; <i32 (...)**> [#uses=1]
63*9880d681SAndroid Build Coastguard Worker	%tmp151.i41 = bitcast i32 (...)** %tmp15.i38 to i8*		; <i8*> [#uses=1]
64*9880d681SAndroid Build Coastguard Worker	%ctg2.i42 = getelementptr i8, i8* %tmp151.i41, i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32)		; <i8*> [#uses=1]
65*9880d681SAndroid Build Coastguard Worker	%tmp2021.i43 = bitcast i8* %ctg2.i42 to i32 (...)**		; <i32 (...)**> [#uses=1]
66*9880d681SAndroid Build Coastguard Worker	%tmp22.i44 = load i32 (...)*, i32 (...)** %tmp2021.i43		; <i32 (...)*> [#uses=1]
67*9880d681SAndroid Build Coastguard Worker	%tmp2223.i45 = bitcast i32 (...)* %tmp22.i44 to void (%struct.B*)*		; <void (%struct.B*)*> [#uses=1]
68*9880d681SAndroid Build Coastguard Worker	br label %_Z3fooiM1BFvvE.exit56
69*9880d681SAndroid Build Coastguard Worker
70*9880d681SAndroid Build Coastguard Worker_Z3fooiM1BFvvE.exit56:		; preds = %cond_true.i46, %_Z3fooiM1BFvvE.exit
71*9880d681SAndroid Build Coastguard Worker	%iftmp.2.0.i49 = phi void (%struct.B*)* [ %tmp2223.i45, %cond_true.i46 ], [ inttoptr (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to void (%struct.B*)*), %_Z3fooiM1BFvvE.exit ]		; <void (%struct.B*)*> [#uses=1]
72*9880d681SAndroid Build Coastguard Worker	%b4.i53 = bitcast %struct.B* %b.i29 to i8*		; <i8*> [#uses=1]
73*9880d681SAndroid Build Coastguard Worker	%ctg25.i54 = getelementptr i8, i8* %b4.i53, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)		; <i8*> [#uses=1]
74*9880d681SAndroid Build Coastguard Worker	%tmp3031.i55 = bitcast i8* %ctg25.i54 to %struct.B*		; <%struct.B*> [#uses=1]
75*9880d681SAndroid Build Coastguard Worker	call void %iftmp.2.0.i49( %struct.B* %tmp3031.i55 )
76*9880d681SAndroid Build Coastguard Worker	%tmp2.i2 = getelementptr %struct.B, %struct.B* %b.i1, i32 0, i32 0		; <i32*> [#uses=1]
77*9880d681SAndroid Build Coastguard Worker	store i32 -1, i32* %tmp2.i2
78*9880d681SAndroid Build Coastguard Worker	br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit28, label %cond_true.i18
79*9880d681SAndroid Build Coastguard Worker
80*9880d681SAndroid Build Coastguard Workercond_true.i18:		; preds = %_Z3fooiM1BFvvE.exit56
81*9880d681SAndroid Build Coastguard Worker	%b2.i7 = bitcast %struct.B* %b.i1 to i8*		; <i8*> [#uses=1]
82*9880d681SAndroid Build Coastguard Worker	%ctg23.i8 = getelementptr i8, i8* %b2.i7, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)		; <i8*> [#uses=1]
83*9880d681SAndroid Build Coastguard Worker	%tmp121314.i9 = bitcast i8* %ctg23.i8 to i32 (...)***		; <i32 (...)***> [#uses=1]
84*9880d681SAndroid Build Coastguard Worker	%tmp15.i10 = load i32 (...)**, i32 (...)*** %tmp121314.i9		; <i32 (...)**> [#uses=1]
85*9880d681SAndroid Build Coastguard Worker	%tmp151.i13 = bitcast i32 (...)** %tmp15.i10 to i8*		; <i8*> [#uses=1]
86*9880d681SAndroid Build Coastguard Worker	%ctg2.i14 = getelementptr i8, i8* %tmp151.i13, i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32)		; <i8*> [#uses=1]
87*9880d681SAndroid Build Coastguard Worker	%tmp2021.i15 = bitcast i8* %ctg2.i14 to i32 (...)**		; <i32 (...)**> [#uses=1]
88*9880d681SAndroid Build Coastguard Worker	%tmp22.i16 = load i32 (...)*, i32 (...)** %tmp2021.i15		; <i32 (...)*> [#uses=1]
89*9880d681SAndroid Build Coastguard Worker	%tmp2223.i17 = bitcast i32 (...)* %tmp22.i16 to void (%struct.B*)*		; <void (%struct.B*)*> [#uses=1]
90*9880d681SAndroid Build Coastguard Worker	br label %_Z3fooiM1BFvvE.exit28
91*9880d681SAndroid Build Coastguard Worker
92*9880d681SAndroid Build Coastguard Worker_Z3fooiM1BFvvE.exit28:		; preds = %cond_true.i18, %_Z3fooiM1BFvvE.exit56
93*9880d681SAndroid Build Coastguard Worker	%iftmp.2.0.i21 = phi void (%struct.B*)* [ %tmp2223.i17, %cond_true.i18 ], [ inttoptr (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to void (%struct.B*)*), %_Z3fooiM1BFvvE.exit56 ]		; <void (%struct.B*)*> [#uses=1]
94*9880d681SAndroid Build Coastguard Worker	%b4.i25 = bitcast %struct.B* %b.i1 to i8*		; <i8*> [#uses=1]
95*9880d681SAndroid Build Coastguard Worker	%ctg25.i26 = getelementptr i8, i8* %b4.i25, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)		; <i8*> [#uses=1]
96*9880d681SAndroid Build Coastguard Worker	%tmp3031.i27 = bitcast i8* %ctg25.i26 to %struct.B*		; <%struct.B*> [#uses=1]
97*9880d681SAndroid Build Coastguard Worker	call void %iftmp.2.0.i21( %struct.B* %tmp3031.i27 )
98*9880d681SAndroid Build Coastguard Worker	ret i32 0
99*9880d681SAndroid Build Coastguard Worker}
100