1 ; RUN: llvm-as < %s | llvm-dis > /dev/null
2 ; RUN: llc < %s -march=cpp -cppgen=program -o -
4 @X = global i32 4, align 16 ; <i32*> [#uses=0]
6 define i32* @test1012() align 32 {
7 %X = alloca i32, align 4 ; <i32*> [#uses=1]
8 %Y = alloca i32, i32 42, align 16 ; <i32*> [#uses=0]
9 %Z = alloca i32 ; <i32*> [#uses=0]
13 define i32* @test1013() {
14 %X = malloc i32, align 4 ; <i32*> [#uses=1]
15 %Y = malloc i32, i32 42, align 16 ; <i32*> [#uses=0]
16 %Z = malloc i32 ; <i32*> [#uses=0]
20 define void @void(i32, i32) {
21 add i32 0, 0 ; <i32>:3 [#uses=2]
22 sub i32 0, 4 ; <i32>:4 [#uses=2]
25 ; <label>:5 ; preds = %5, %2
26 add i32 %0, %1 ; <i32>:6 [#uses=2]
27 sub i32 %6, %4 ; <i32>:7 [#uses=1]
28 icmp sle i32 %7, %3 ; <i1>:8 [#uses=1]
29 br i1 %8, label %9, label %5
31 ; <label>:9 ; preds = %5
32 add i32 %0, %1 ; <i32>:10 [#uses=0]
33 sub i32 %6, %4 ; <i32>:11 [#uses=1]
34 icmp sle i32 %11, %3 ; <i1>:12 [#uses=0]
43 define fastcc void @foo() {
47 define coldcc void @bar() {
48 call fastcc void @foo( )
52 define void @structret({ i8 }* sret %P) {
53 call void @structret( { i8 }* %P sret )
61 define coldcc void @bar2() {
62 call fastcc void @foo( )
66 define cc42 void @bar3() {
67 invoke fastcc void @foo( )
68 to label %Ok unwind label %U
78 call cc42 void @bar( )
79 invoke cc42 void @bar3( )
80 to label %Ok unwind label %U
88 ; ModuleID = 'calltest.ll'
89 %FunTy = type i32 (i32)
91 define i32 @test1000(i32 %i0) {
95 define void @invoke(%FunTy* %x) {
96 %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
97 %foo2 = tail call i32 %x( i32 123 ) ; <i32> [#uses=0]
101 define i32 @main(i32 %argc) {
102 %retval = call i32 @test1000( i32 %argc ) ; <i32> [#uses=2]
103 %two = add i32 %retval, %retval ; <i32> [#uses=1]
104 %retval2 = invoke i32 @test1000( i32 %argc )
105 to label %Next unwind label %Error ; <i32> [#uses=1]
108 %two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
109 call void @invoke( %FunTy* @test1000 )
115 ; ModuleID = 'casttest.ll'
117 define i16 @FunFunc(i64 %x, i8 %z) {
119 %cast110 = sext i8 %z to i16 ; <i16> [#uses=1]
120 %cast10 = trunc i64 %x to i16 ; <i16> [#uses=1]
121 %reg109 = add i16 %cast110, %cast10 ; <i16> [#uses=1]
124 ; ModuleID = 'cfgstructures.ll'
126 define void @irreducible(i1 %cond) {
127 br i1 %cond, label %X, label %Y
136 define void @sharedheader(i1 %cond) {
139 A: ; preds = %Y, %X, %0
140 br i1 %cond, label %X, label %Y
149 define void @nested(i1 %cond1, i1 %cond2, i1 %cond3) {
152 Loop1: ; preds = %L2Exit, %0
155 Loop2: ; preds = %L3Exit, %Loop1
158 Loop3: ; preds = %Loop3, %Loop2
159 br i1 %cond3, label %Loop3, label %L3Exit
161 L3Exit: ; preds = %Loop3
162 br i1 %cond2, label %Loop2, label %L2Exit
164 L2Exit: ; preds = %L3Exit
165 br i1 %cond1, label %Loop1, label %L1Exit
167 L1Exit: ; preds = %L2Exit
170 ; ModuleID = 'constexpr.ll'
171 %SAType = type { i32, { [2 x float], i64 } }
172 %SType = type { i32, { float, { i8 } }, i64 }
173 global i64 1 ; <i64*>:0 [#uses=0]
174 global i64 74514 ; <i64*>:1 [#uses=0]
175 @t2 = global i32* @t1 ; <i32**> [#uses=0]
176 @t3 = global i32* @t1 ; <i32**> [#uses=2]
177 @t1 = global i32 4 ; <i32*> [#uses=2]
178 @t4 = global i32** @t3 ; <i32***> [#uses=1]
179 @t5 = global i32** @t3 ; <i32***> [#uses=0]
180 @t6 = global i32*** @t4 ; <i32****> [#uses=0]
181 @t7 = global float* inttoptr (i32 12345678 to float*) ; <float**> [#uses=0]
182 @t9 = global i32 8 ; <i32*> [#uses=0]
183 global i32* bitcast (float* @4 to i32*) ; <i32**>:2 [#uses=0]
184 global float* @4 ; <float**>:3 [#uses=0]
185 global float 0.000000e+00 ; <float*>:4 [#uses=2]
186 @array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
187 @arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ; <i32**> [#uses=1]
188 @arrayPtr5 = global i32** getelementptr (i32** @arrayPtr, i64 5) ; <i32***> [#uses=0]
189 @somestr = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=2]
190 @char5 = global i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 5) ; <i8**> [#uses=0]
191 @char8a = global i32* bitcast (i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 8) to i32*) ; <i32**> [#uses=0]
192 @char8b = global i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 8) ; <i8**> [#uses=0]
193 @S1 = global %SType* null ; <%SType**> [#uses=1]
194 @S2c = constant %SType {
196 { float, { i8 } } { float 2.000000e+00, { i8 } { i8 3 } },
197 i64 4 } ; <%SType*> [#uses=3]
198 @S3c = constant %SAType { i32 1, { [2 x float], i64 } { [2 x float] [ float 2.000000e+00, float 3.000000e+00 ], i64 4 } } ; <%SAType*> [#uses=1]
199 @S1ptr = global %SType** @S1 ; <%SType***> [#uses=0]
200 @S2 = global %SType* @S2c ; <%SType**> [#uses=0]
201 @S3 = global %SAType* @S3c ; <%SAType**> [#uses=0]
202 @S1fld1a = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) ; <float**> [#uses=0]
203 @S1fld1b = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) ; <float**> [#uses=1]
204 @S1fld1bptr = global float** @S1fld1b ; <float***> [#uses=0]
205 @S2fld3 = global i8* getelementptr (%SType* @S2c, i64 0, i32 1, i32 1, i32 0) ; <i8**> [#uses=0]
207 ; ModuleID = 'constpointer.ll'
208 @cpt3 = global i32* @cpt1 ; <i32**> [#uses=1]
209 @cpt1 = global i32 4 ; <i32*> [#uses=2]
210 @cpt4 = global i32** @cpt3 ; <i32***> [#uses=0]
211 @cpt2 = global i32* @cpt1 ; <i32**> [#uses=0]
212 global float* @7 ; <float**>:0 [#uses=0]
213 global float* @7 ; <float**>:1 [#uses=0]
214 global float 0.000000e+00 ; <float*>:2 [#uses=3]
215 global float* @7 ; <float**>:3 [#uses=0]
216 @fptr = global void ()* @f ; <void ()**> [#uses=0]
217 @sptr1 = global [11 x i8]* @somestr ; <[11 x i8]**> [#uses=0]
218 @somestr2 = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=2]
219 @sptr2 = global [11 x i8]* @somestr2 ; <[11 x i8]**> [#uses=0]
222 ; ModuleID = 'escaped_label.ll'
225 br label "foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?"
227 "foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?": ; preds = %0
230 ; ModuleID = 'float.ll'
231 @F1 = global float 4.000000e+00 ; <float*> [#uses=0]
232 @D1 = global double 4.000000e+00 ; <double*> [#uses=0]
233 ; ModuleID = 'fold-fpcast.ll'
235 define i32 @test1() {
239 define float @test1002() {
240 ret float 0x36E1000000000000
243 define i64 @test3() {
244 ret i64 4614256656431372362
247 define double @test4() {
248 ret double 2.075076e-322
250 ; ModuleID = 'forwardreftest.ll'
251 %myfn = type float (i32, double, i32, i16)
253 %thisfuncty = type i32 (i32)*
255 declare void @F(%thisfuncty, %thisfuncty, %thisfuncty)
257 define i32 @zarro2(i32 %Func) {
259 add i32 0, 10 ; <i32>:0 [#uses=0]
263 define i32 @test1004(i32) {
264 call void @F( %thisfuncty @zarro2, %thisfuncty @test1004, %thisfuncty @foozball )
268 define i32 @foozball(i32) {
272 ; ModuleID = 'globalredefinition.ll'
273 @A = global i32* @B ; <i32**> [#uses=0]
274 @B = global i32 7 ; <i32*> [#uses=1]
276 define void @test12312() {
279 ; ModuleID = 'global_section.ll'
280 @GlobSec = global i32 4, section "foo", align 16
282 define void @test1005() section "bar" {
286 ; ModuleID = 'globalvars.ll'
287 @MyVar = external global i32 ; <i32*> [#uses=1]
288 @MyIntList = external global { \2*, i32 } ; <{ \2*, i32 }*> [#uses=1]
289 external global i32 ; <i32*>:0 [#uses=0]
290 @AConst = constant i32 123 ; <i32*> [#uses=0]
291 @AString = constant [4 x i8] c"test" ; <[4 x i8]*> [#uses=0]
292 @ZeroInit = global { [100 x i32], [40 x float] } zeroinitializer ; <{ [100 x i32], [40 x float] }*> [#uses=0]
294 define i32 @foo10015(i32 %blah) {
295 store i32 5, i32* @MyVar
296 %idx = getelementptr { \2*, i32 }* @MyIntList, i64 0, i32 1 ; <i32*> [#uses=1]
297 store i32 12, i32* %idx
300 ; ModuleID = 'indirectcall2.ll'
302 define i64 @test1006(i64 %X) {
306 define i64 @fib(i64 %n) {
308 %T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
309 br i1 %T, label %BaseCase, label %RecurseCase
311 RecurseCase: ; preds = %0
312 %result = call i64 @test1006( i64 %n ) ; <i64> [#uses=0]
315 BaseCase: ; preds = %RecurseCase, %0
316 %X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
319 ; ModuleID = 'indirectcall.ll'
321 declare i32 @atoi(i8*)
323 define i64 @fibonacc(i64 %n) {
324 icmp ult i64 %n, 2 ; <i1>:1 [#uses=1]
325 br i1 %1, label %BaseCase, label %RecurseCase
327 BaseCase: ; preds = %0
330 RecurseCase: ; preds = %0
331 %n2 = sub i64 %n, 2 ; <i64> [#uses=1]
332 %n1 = sub i64 %n, 1 ; <i64> [#uses=1]
333 %f2 = call i64 @fibonacc( i64 %n2 ) ; <i64> [#uses=1]
334 %f1 = call i64 @fibonacc( i64 %n1 ) ; <i64> [#uses=1]
335 %result = add i64 %f2, %f1 ; <i64> [#uses=1]
339 define i64 @realmain(i32 %argc, i8** %argv) {
341 icmp eq i32 %argc, 2 ; <i1>:1 [#uses=1]
342 br i1 %1, label %HasArg, label %Continue
345 %n1 = add i32 1, 1 ; <i32> [#uses=1]
348 Continue: ; preds = %HasArg, %0
349 %n = phi i32 [ %n1, %HasArg ], [ 1, %0 ] ; <i32> [#uses=1]
350 %N = sext i32 %n to i64 ; <i64> [#uses=1]
351 %F = call i64 @fib( i64 %N ) ; <i64> [#uses=1]
355 define i64 @trampoline(i64 %n, i64 (i64)* %fibfunc) {
356 %F = call i64 %fibfunc( i64 %n ) ; <i64> [#uses=1]
360 define i32 @main2() {
361 %Result = call i64 @trampoline( i64 10, i64 (i64)* @fib ) ; <i64> [#uses=1]
362 %Result.upgrd.1 = trunc i64 %Result to i32 ; <i32> [#uses=1]
363 ret i32 %Result.upgrd.1
365 ; ModuleID = 'inlineasm.ll'
366 module asm "this is an inline asm block"
367 module asm "this is another inline asm block"
369 define i32 @test1007() {
370 %X = call i32 asm "tricky here $0, $1", "=r,r"( i32 4 ) ; <i32> [#uses=1]
371 call void asm sideeffect "eieio", ""( )
374 ; ModuleID = 'instructions.ll'
376 define i32 @test_extractelement(<4 x i32> %V) {
377 %R = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1]
381 define <4 x i32> @test_insertelement(<4 x i32> %V) {
382 %R = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1]
386 define <4 x i32> @test_shufflevector_u(<4 x i32> %V) {
387 %R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1]
391 define <4 x float> @test_shufflevector_f(<4 x float> %V) {
392 %R = shufflevector <4 x float> %V, <4 x float> undef, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x float>> [#uses=1]
395 ; ModuleID = 'intrinsics.ll'
397 declare i1 @llvm.isunordered.f32(float, float)
399 declare i1 @llvm.isunordered.f64(double, double)
401 declare void @llvm.prefetch(i8*, i32, i32)
403 declare float @llvm.sqrt.f32(float)
405 declare double @llvm.sqrt.f64(double)
407 define void @libm() {
408 fcmp uno float 1.000000e+00, 2.000000e+00 ; <i1>:1 [#uses=0]
409 fcmp uno double 3.000000e+00, 4.000000e+00 ; <i1>:2 [#uses=0]
410 call void @llvm.prefetch( i8* null, i32 1, i32 3 )
411 call float @llvm.sqrt.f32( float 5.000000e+00 ) ; <float>:3 [#uses=0]
412 call double @llvm.sqrt.f64( double 6.000000e+00 ) ; <double>:4 [#uses=0]
413 call i8 @llvm.ctpop.i8( i8 10 ) ; <i32>:5 [#uses=1]
414 call i16 @llvm.ctpop.i16( i16 11 ) ; <i32>:7 [#uses=1]
415 call i32 @llvm.ctpop.i32( i32 12 ) ; <i32>:9 [#uses=1]
416 call i64 @llvm.ctpop.i64( i64 13 ) ; <i32>:11 [#uses=1]
417 call i8 @llvm.ctlz.i8( i8 14 ) ; <i32>:13 [#uses=1]
418 call i16 @llvm.ctlz.i16( i16 15 ) ; <i32>:15 [#uses=1]
419 call i32 @llvm.ctlz.i32( i32 16 ) ; <i32>:17 [#uses=1]
420 call i64 @llvm.ctlz.i64( i64 17 ) ; <i32>:19 [#uses=1]
421 call i8 @llvm.cttz.i8( i8 18 ) ; <i32>:21 [#uses=1]
422 call i16 @llvm.cttz.i16( i16 19 ) ; <i32>:23 [#uses=1]
423 call i32 @llvm.cttz.i32( i32 20 ) ; <i32>:25 [#uses=1]
424 call i64 @llvm.cttz.i64( i64 21 ) ; <i32>:27 [#uses=1]
428 declare i8 @llvm.ctpop.i8(i8)
430 declare i16 @llvm.ctpop.i16(i16)
432 declare i32 @llvm.ctpop.i32(i32)
434 declare i64 @llvm.ctpop.i64(i64)
436 declare i8 @llvm.ctlz.i8(i8)
438 declare i16 @llvm.ctlz.i16(i16)
440 declare i32 @llvm.ctlz.i32(i32)
442 declare i64 @llvm.ctlz.i64(i64)
444 declare i8 @llvm.cttz.i8(i8)
446 declare i16 @llvm.cttz.i16(i16)
448 declare i32 @llvm.cttz.i32(i32)
450 declare i64 @llvm.cttz.i64(i64)
452 ; ModuleID = 'packed.ll'
453 @foo1 = external global <4 x float> ; <<4 x float>*> [#uses=2]
454 @foo102 = external global <2 x i32> ; <<2 x i32>*> [#uses=2]
456 define void @main3() {
457 store <4 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >, <4 x float>* @foo1
458 store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo102
459 %l1 = load <4 x float>* @foo1 ; <<4 x float>> [#uses=0]
460 %l2 = load <2 x i32>* @foo102 ; <<2 x i32>> [#uses=0]
464 ; ModuleID = 'properties.ll'
465 target datalayout = "e-p:32:32"
466 target triple = "proc-vend-sys"
467 deplibs = [ "m", "c" ]
468 ; ModuleID = 'prototype.ll'
470 declare i32 @bar1017(i32 %in)
472 define i32 @foo1016(i32 %blah) {
473 %xx = call i32 @bar1017( i32 %blah ) ; <i32> [#uses=1]
477 ; ModuleID = 'recursivetype.ll'
478 %list = type { %list*, i32 }
480 declare i8* @malloc(i32)
482 define void @InsertIntoListTail(%list** %L, i32 %Data) {
484 %reg116 = load %list** %L ; <%list*> [#uses=1]
485 %cast1004 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
486 %cond1000 = icmp eq %list* %reg116, %cast1004 ; <i1> [#uses=1]
487 br i1 %cond1000, label %bb3, label %bb2
489 bb2: ; preds = %bb2, %bb1
490 %reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
491 %cast1010 = bitcast %list** %reg117 to %list*** ; <%list***> [#uses=1]
492 %reg118 = load %list*** %cast1010 ; <%list**> [#uses=3]
493 %reg109 = load %list** %reg118 ; <%list*> [#uses=1]
494 %cast1005 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
495 %cond1001 = icmp ne %list* %reg109, %cast1005 ; <i1> [#uses=1]
496 br i1 %cond1001, label %bb2, label %bb3
498 bb3: ; preds = %bb2, %bb1
499 %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
500 %cast1006 = bitcast %list** %reg119 to i8** ; <i8**> [#uses=1]
501 %reg111 = call i8* @malloc( i32 16 ) ; <i8*> [#uses=3]
502 store i8* %reg111, i8** %cast1006
503 %reg111.upgrd.1 = ptrtoint i8* %reg111 to i64 ; <i64> [#uses=1]
504 %reg1002 = add i64 %reg111.upgrd.1, 8 ; <i64> [#uses=1]
505 %reg1002.upgrd.2 = inttoptr i64 %reg1002 to i8* ; <i8*> [#uses=1]
506 %cast1008 = bitcast i8* %reg1002.upgrd.2 to i32* ; <i32*> [#uses=1]
507 store i32 %Data, i32* %cast1008
508 %cast1003 = inttoptr i64 0 to i64* ; <i64*> [#uses=1]
509 %cast1009 = bitcast i8* %reg111 to i64** ; <i64**> [#uses=1]
510 store i64* %cast1003, i64** %cast1009
514 define %list* @FindData(%list* %L, i32 %Data) {
518 bb2: ; preds = %bb6, %bb1
519 %reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ; <%list*> [#uses=4]
520 %cast1014 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
521 %cond1011 = icmp ne %list* %reg115, %cast1014 ; <i1> [#uses=1]
522 br i1 %cond1011, label %bb4, label %bb3
528 %idx = getelementptr %list* %reg115, i64 0, i32 1 ; <i32*> [#uses=1]
529 %reg111 = load i32* %idx ; <i32> [#uses=1]
530 %cond1013 = icmp ne i32 %reg111, %Data ; <i1> [#uses=1]
531 br i1 %cond1013, label %bb6, label %bb5
537 %idx2 = getelementptr %list* %reg115, i64 0, i32 0 ; <%list**> [#uses=1]
538 %reg116 = load %list** %idx2 ; <%list*> [#uses=1]
541 ; ModuleID = 'simplecalltest.ll'
542 %FunTy = type i32 (i32)
544 define void @invoke1019(%FunTy* %x) {
545 %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
549 define i32 @main4(i32 %argc, i8** %argv, i8** %envp) {
550 %retval = call i32 @test1008( i32 %argc ) ; <i32> [#uses=2]
551 %two = add i32 %retval, %retval ; <i32> [#uses=1]
552 %retval2 = call i32 @test1008( i32 %argc ) ; <i32> [#uses=1]
553 %two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
554 call void @invoke1019( %FunTy* @test1008 )
558 define i32 @test1008(i32 %i0) {
561 ; ModuleID = 'smallest.ll'
562 ; ModuleID = 'small.ll'
565 define i32 @foo1020(i32 %in) {
569 ; ModuleID = 'testalloca.ll'
570 %inners = type { float, { i8 } }
571 %struct = type { i32, %inners, i64 }
573 define i32 @testfunction(i32 %i0, i32 %j0) {
574 alloca i8, i32 5 ; <i8*>:1 [#uses=0]
575 %ptr = alloca i32 ; <i32*> [#uses=2]
576 store i32 3, i32* %ptr
577 %val = load i32* %ptr ; <i32> [#uses=0]
578 %sptr = alloca %struct ; <%struct*> [#uses=2]
579 %nsptr = getelementptr %struct* %sptr, i64 0, i32 1 ; <%inners*> [#uses=1]
580 %ubsptr = getelementptr %inners* %nsptr, i64 0, i32 1 ; <{ i8 }*> [#uses=1]
581 %idx = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
583 %fptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 0 ; <float*> [#uses=1]
584 store float 4.000000e+00, float* %fptr
587 ; ModuleID = 'testconstants.ll'
588 @somestr3 = constant [11 x i8] c"hello world"
589 @array99 = constant [2 x i32] [ i32 12, i32 52 ]
590 constant { i32, i32 } { i32 4, i32 3 } ; <{ i32, i32 }*>:0 [#uses=0]
592 define [2 x i32]* @testfunction99(i32 %i0, i32 %j0) {
593 ret [2 x i32]* @array
596 define i8* @otherfunc(i32, double) {
597 %somestr = getelementptr [11 x i8]* @somestr3, i64 0, i64 0 ; <i8*> [#uses=1]
601 define i8* @yetanotherfunc(i32, double) {
605 define i32 @negativeUnsigned() {
609 define i32 @largeSigned() {
612 ; ModuleID = 'testlogical.ll'
614 define i32 @simpleAdd(i32 %i0, i32 %j0) {
615 %t1 = xor i32 %i0, %j0 ; <i32> [#uses=1]
616 %t2 = or i32 %i0, %j0 ; <i32> [#uses=1]
617 %t3 = and i32 %t1, %t2 ; <i32> [#uses=1]
620 ; ModuleID = 'testmemory.ll'
621 %complexty = type { i32, { [4 x i8*], float }, double }
622 %struct = type { i32, { float, { i8 } }, i64 }
624 define i32 @main6() {
625 call i32 @testfunction98( i64 0, i64 1 )
629 define i32 @testfunction98(i64 %i0, i64 %j0) {
630 %array0 = malloc [4 x i8] ; <[4 x i8]*> [#uses=2]
631 %size = add i32 2, 2 ; <i32> [#uses=1]
632 %array1 = malloc i8, i32 4 ; <i8*> [#uses=1]
633 %array2 = malloc i8, i32 %size ; <i8*> [#uses=1]
634 %idx = getelementptr [4 x i8]* %array0, i64 0, i64 2 ; <i8*> [#uses=1]
635 store i8 123, i8* %idx
636 free [4 x i8]* %array0
639 %aa = alloca %complexty, i32 5 ; <%complexty*> [#uses=1]
640 %idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0 ; <i8**> [#uses=1]
641 store i8* null, i8** %idx2
642 %ptr = alloca i32 ; <i32*> [#uses=2]
643 store i32 3, i32* %ptr
644 %val = load i32* %ptr ; <i32> [#uses=0]
645 %sptr = alloca %struct ; <%struct*> [#uses=1]
646 %ubsptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 1 ; <{ i8 }*> [#uses=1]
647 %idx3 = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
648 store i8 4, i8* %idx3
651 ; ModuleID = 'testswitch.ll'
654 define i32 @squared(i32 %i0) {
655 switch i32 %i0, label %Default [
661 Default: ; preds = %0
673 ; ModuleID = 'testvarargs.ll'
675 declare i32 @printf(i8*, ...)
677 define i32 @testvarar() {
678 call i32 (i8*, ...)* @printf( i8* null, i32 12, i8 42 ) ; <i32>:1 [#uses=1]
681 ; ModuleID = 'undefined.ll'
682 @X2 = global i32 undef ; <i32*> [#uses=0]
684 declare i32 @atoi(i8*)
686 define i32 @test1009() {
690 define i32 @test1003() {
691 %X = add i32 undef, 1 ; <i32> [#uses=1]
694 ; ModuleID = 'unreachable.ll'
698 define i32 @foo1021() {
702 define double @xyz() {
706 ; ModuleID = 'varargs.ll'
708 declare void @llvm.va_start(i8* %ap)
710 declare void @llvm.va_copy(i8* %aq, i8* %ap)
712 declare void @llvm.va_end(i8* %ap)
714 define i32 @test1010(i32 %X, ...) {
715 %ap = alloca i8* ; <i8**> [#uses=4]
716 %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
717 call void @llvm.va_start( i8* %va.upgrd.1 )
718 %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
719 %aq = alloca i8* ; <i8**> [#uses=2]
720 %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
721 %va1.upgrd.3 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
722 call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
723 %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
724 call void @llvm.va_end( i8* %va.upgrd.4 )
725 %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
726 call void @llvm.va_end( i8* %va.upgrd.5 )
729 ; ModuleID = 'varargs_new.ll'
731 declare void @llvm.va_start(i8*)
733 declare void @llvm.va_copy(i8*, i8*)
735 declare void @llvm.va_end(i8*)
737 define i32 @test1011(i32 %X, ...) {
738 %ap = alloca i8* ; <i8**> [#uses=4]
739 %aq = alloca i8* ; <i8**> [#uses=2]
740 %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
741 call void @llvm.va_start( i8* %va.upgrd.1 )
742 %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
743 %apv = load i8** %ap ; <i8*> [#uses=1]
744 %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
745 %va1.upgrd.3 = bitcast i8* %apv to i8* ; <i8*> [#uses=1]
746 call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
747 %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
748 call void @llvm.va_end( i8* %va.upgrd.4 )
749 %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
750 call void @llvm.va_end( i8* %va.upgrd.5 )
753 ; ModuleID = 'weirdnames.ll'
755 @"%.*+ foo" = global "&^ " { i32 5 } ; <"&^ "*> [#uses=0]
756 @"0" = global float 0.000000e+00 ; <float*> [#uses=0]