2014-04-04 01:47:24 +02:00
|
|
|
; RUN: llc -mtriple=thumb-eabi %s -o /dev/null
|
|
|
|
; RUN: llc -mtriple=thumb-linux %s -o - | FileCheck %s
|
|
|
|
; RUN: llc -mtriple=thumb-darwin %s -o - | FileCheck %s
|
2007-02-01 02:56:43 +01:00
|
|
|
|
2008-02-17 21:02:20 +01:00
|
|
|
@str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
|
2006-08-25 19:57:36 +02:00
|
|
|
|
2008-02-17 21:02:20 +01:00
|
|
|
define void @f(i32 %a, ...) {
|
2006-08-25 19:57:36 +02:00
|
|
|
entry:
|
2008-02-17 21:02:20 +01:00
|
|
|
%va = alloca i8*, align 4 ; <i8**> [#uses=4]
|
|
|
|
%va.upgrd.1 = bitcast i8** %va to i8* ; <i8*> [#uses=1]
|
|
|
|
call void @llvm.va_start( i8* %va.upgrd.1 )
|
|
|
|
br label %bb
|
|
|
|
|
|
|
|
bb: ; preds = %bb, %entry
|
|
|
|
%a_addr.0 = phi i32 [ %a, %entry ], [ %tmp5, %bb ] ; <i32> [#uses=2]
|
2011-11-27 07:54:59 +01:00
|
|
|
%tmp = load volatile i8** %va ; <i8*> [#uses=2]
|
2008-02-17 21:02:20 +01:00
|
|
|
%tmp2 = getelementptr i8* %tmp, i32 4 ; <i8*> [#uses=1]
|
2011-11-27 07:54:59 +01:00
|
|
|
store volatile i8* %tmp2, i8** %va
|
2008-02-17 21:02:20 +01:00
|
|
|
%tmp5 = add i32 %a_addr.0, -1 ; <i32> [#uses=1]
|
|
|
|
%tmp.upgrd.2 = icmp eq i32 %a_addr.0, 1 ; <i1> [#uses=1]
|
|
|
|
br i1 %tmp.upgrd.2, label %bb7, label %bb
|
|
|
|
|
|
|
|
bb7: ; preds = %bb
|
|
|
|
%tmp3 = bitcast i8* %tmp to i32* ; <i32*> [#uses=1]
|
|
|
|
%tmp.upgrd.3 = load i32* %tmp3 ; <i32> [#uses=1]
|
|
|
|
%tmp10 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @str, i32 0, i64 0), i32 %tmp.upgrd.3 ) ; <i32> [#uses=0]
|
|
|
|
%va.upgrd.4 = bitcast i8** %va to i8* ; <i8*> [#uses=1]
|
|
|
|
call void @llvm.va_end( i8* %va.upgrd.4 )
|
|
|
|
ret void
|
2006-08-25 19:57:36 +02:00
|
|
|
}
|
|
|
|
|
2008-02-17 21:02:20 +01:00
|
|
|
declare void @llvm.va_start(i8*)
|
2006-08-25 19:57:36 +02:00
|
|
|
|
2008-02-17 21:02:20 +01:00
|
|
|
declare i32 @printf(i8*, ...)
|
2006-08-25 19:57:36 +02:00
|
|
|
|
2008-02-17 21:02:20 +01:00
|
|
|
declare void @llvm.va_end(i8*)
|
2014-04-04 01:47:24 +02:00
|
|
|
|
|
|
|
; CHECK: pop
|
|
|
|
; CHECK: pop
|
|
|
|
; CHECK-NOT: pop
|
|
|
|
|