1 ; RUN: llvm-as < %s | llc -march=thumb
2 ; RUN: llvm-as < %s | llc -mtriple=thumb-linux | grep pop | count 1
3 ; RUN: llvm-as < %s | llc -mtriple=thumb-darwin | grep pop | count 2
5 @str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
7 define void @f(i32 %a, ...) {
9 %va = alloca i8*, align 4 ; <i8**> [#uses=4]
10 %va.upgrd.1 = bitcast i8** %va to i8* ; <i8*> [#uses=1]
11 call void @llvm.va_start( i8* %va.upgrd.1 )
14 bb: ; preds = %bb, %entry
15 %a_addr.0 = phi i32 [ %a, %entry ], [ %tmp5, %bb ] ; <i32> [#uses=2]
16 %tmp = volatile load i8** %va ; <i8*> [#uses=2]
17 %tmp2 = getelementptr i8* %tmp, i32 4 ; <i8*> [#uses=1]
18 volatile store i8* %tmp2, i8** %va
19 %tmp5 = add i32 %a_addr.0, -1 ; <i32> [#uses=1]
20 %tmp.upgrd.2 = icmp eq i32 %a_addr.0, 1 ; <i1> [#uses=1]
21 br i1 %tmp.upgrd.2, label %bb7, label %bb
24 %tmp3 = bitcast i8* %tmp to i32* ; <i32*> [#uses=1]
25 %tmp.upgrd.3 = load i32* %tmp3 ; <i32> [#uses=1]
26 %tmp10 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @str, i32 0, i64 0), i32 %tmp.upgrd.3 ) ; <i32> [#uses=0]
27 %va.upgrd.4 = bitcast i8** %va to i8* ; <i8*> [#uses=1]
28 call void @llvm.va_end( i8* %va.upgrd.4 )
32 declare void @llvm.va_start(i8*)
34 declare i32 @printf(i8*, ...)
36 declare void @llvm.va_end(i8*)