1 ; RUN: llvm-as < %s | llc
3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
4 target triple = "i686-apple-darwin8"
5 %llvm.dbg.anchor.type = type { i32, i32 }
6 %llvm.dbg.basictype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, i32 }
7 %llvm.dbg.compile_unit.type = type { i32, %struct.anon*, i32, i8*, i8*, i8* }
8 %llvm.dbg.compositetype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon*, %struct.anon* }
9 %llvm.dbg.derivedtype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon* }
10 %llvm.dbg.global_variable.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1, %struct.anon* }
11 %llvm.dbg.subprogram.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1 }
12 %llvm.dbg.subrange.type = type { i32, i64, i64 }
13 %llvm.dbg.variable.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, %struct.anon* }
14 %struct.S271 = type { [0 x %struct.anon], %struct.anon }
15 %struct.anon = type { }
16 @llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type {
18 %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*),
19 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
20 i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0),
21 i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0),
23 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
25 %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*),
27 i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
28 @llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
29 @llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
31 %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %struct.anon*),
33 i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0),
34 i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0),
35 i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
36 @llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
37 @.str = internal constant [6 x i8] c"foo.c\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
38 @.str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1]
39 @.str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5546) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1]
40 @.str3 = internal constant [4 x i8] c"var\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
41 @llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type {
43 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
51 %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
52 @llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
54 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
55 i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0),
62 i32 6 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
63 @.str4 = internal constant [5 x i8] c"char\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
64 @llvm.dbg.variable = internal constant %llvm.dbg.variable.type {
66 %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*),
67 i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0),
68 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
70 %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
71 @.str5 = internal constant [7 x i8] c"retval\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
72 @a271 = weak global [0 x %struct.S271] zeroinitializer ; <[0 x %struct.S271]*> [#uses=3]
73 @llvm.dbg.subprogram6 = internal constant %llvm.dbg.subprogram.type {
75 %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*),
76 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
77 i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0),
78 i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0),
80 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
82 %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*),
84 i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
85 @.str7 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
86 @llvm.dbg.basictype8 = internal constant %llvm.dbg.basictype.type {
88 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
89 i8* getelementptr ([4 x i8]* @.str9, i32 0, i32 0),
96 i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
97 @.str9 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
98 @llvm.dbg.variable10 = internal constant %llvm.dbg.variable.type {
100 %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*),
101 i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0),
102 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
104 %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
105 @llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
107 %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to %struct.anon*),
108 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
109 i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0),
110 i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0),
112 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
114 %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to %struct.anon*),
117 %struct.anon* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
118 @llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
119 @.str11 = internal constant [5 x i8] c"a271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
120 @llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type {
122 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
124 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
130 %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype12 to %struct.anon*),
131 %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array25 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
132 @llvm.dbg.compositetype12 = internal constant %llvm.dbg.compositetype.type {
134 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
135 i8* getelementptr ([5 x i8]* @.str13, i32 0, i32 0),
136 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
143 %struct.anon* bitcast ([2 x %struct.anon*]* @llvm.dbg.array23 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
144 @.str13 = internal constant [5 x i8] c"S271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
145 @llvm.dbg.derivedtype14 = internal constant %llvm.dbg.derivedtype.type {
148 i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0),
149 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
155 %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype16 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
156 @.str15 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
157 @llvm.dbg.compositetype16 = internal constant %llvm.dbg.compositetype.type {
159 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
161 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
167 %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype17 to %struct.anon*),
168 %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array18 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
169 @llvm.dbg.compositetype17 = internal constant %llvm.dbg.compositetype.type {
171 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
173 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
180 %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
181 @llvm.dbg.array = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1]
182 @llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type {
185 i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
186 @llvm.dbg.array18 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1]
187 @llvm.dbg.derivedtype19 = internal constant %llvm.dbg.derivedtype.type {
190 i8* getelementptr ([2 x i8]* @.str20, i32 0, i32 0),
191 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
197 %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype21 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
198 @.str20 = internal constant [2 x i8] c"b\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
199 @llvm.dbg.compositetype21 = internal constant %llvm.dbg.compositetype.type {
201 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
203 %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
210 %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array22 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
211 @llvm.dbg.array22 = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1]
212 @llvm.dbg.array23 = internal constant [2 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype14 to %struct.anon*), %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype19 to %struct.anon*) ], section "llvm.metadata" ; <[2 x %struct.anon*]*> [#uses=1]
213 @llvm.dbg.subrange24 = internal constant %llvm.dbg.subrange.type {
216 i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
217 @llvm.dbg.array25 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange24 to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1]
221 %retval = alloca i8* ; <i8**> [#uses=3]
222 %tmp = alloca i8* ; <i8**> [#uses=2]
223 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
224 call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) )
225 call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
226 %retval1 = bitcast i8** %retval to %struct.anon* ; <%struct.anon*> [#uses=1]
227 call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to %struct.anon*) )
228 bitcast %struct.S271* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0) to i8* ; <i8*>:0 [#uses=0]
229 store i8* bitcast ([0 x %struct.S271]* @a271 to i8*), i8** %tmp, align 4
230 %tmp2 = load i8** %tmp, align 4 ; <i8*> [#uses=1]
231 store i8* %tmp2, i8** %retval, align 4
234 return: ; preds = %entry
235 %retval3 = load i8** %retval ; <i8*> [#uses=1]
236 call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
237 call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) )
241 declare void @llvm.dbg.func.start(%struct.anon*) nounwind
243 declare void @llvm.dbg.stoppoint(i32, i32, %struct.anon*) nounwind
245 declare void @llvm.dbg.declare(%struct.anon*, %struct.anon*) nounwind
247 declare void @llvm.dbg.region.end(%struct.anon*) nounwind
251 %retval = alloca i32 ; <i32*> [#uses=2]
252 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
253 call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) )
254 call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
255 %retval1 = bitcast i32* %retval to %struct.anon* ; <%struct.anon*> [#uses=1]
256 call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable10 to %struct.anon*) )
259 return: ; preds = %entry
260 %retval2 = load i32* %retval ; <i32> [#uses=1]
261 call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
262 call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) )