X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FFeature%2Fcalltest.ll;h=feafd3cd208486f8616c49375545c91bc37d32ad;hb=fb7000fcbde3b5257ac055e1e5abdee5df21842b;hp=f015223c5d75acc528b219579303be9b92bad1bb;hpb=161a4c9d79bdf87482c5d4bbfd1240d2a8779e5a;p=oota-llvm.git diff --git a/test/Feature/calltest.ll b/test/Feature/calltest.ll index f015223c5d7..feafd3cd208 100644 --- a/test/Feature/calltest.ll +++ b/test/Feature/calltest.ll @@ -1,34 +1,32 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%FunTy = type int(int) +%FunTy = type i32 (i32) -declare int "test"(int) ; Test forward declaration merging +declare i32 @test(i32) ; Test forward declaration merging -implementation - -void "invoke"(%FunTy *%x) { - %foo = call %FunTy* %x(int 123) - %foo2 = tail call %FunTy* %x(int 123) - ret void +define void @invoke(%FunTy* %x) { + %foo = call i32 %x( i32 123 ) ; [#uses=0] + %foo2 = tail call i32 %x( i32 123 ) ; [#uses=0] + ret void } -int "main"(int %argc) ; TODO: , sbyte **argv, sbyte **envp) -begin - %retval = call int (int) *%test(int %argc) - %two = add int %retval, %retval - %retval2 = invoke int %test(int %argc) - to label %Next except label %Error -Next: - %two2 = add int %two, %retval2 - call void %invoke (%FunTy* %test) - ret int %two2 -Error: - ret int -1 -end +define i32 @main(i32 %argc) { + %retval = call i32 @test( i32 %argc ) ; [#uses=2] + %two = add i32 %retval, %retval ; [#uses=1] + %retval2 = invoke i32 @test( i32 %argc ) + to label %Next unwind label %Error ; [#uses=1] + +Next: ; preds = %0 + %two2 = add i32 %two, %retval2 ; [#uses=1] + call void @invoke( %FunTy* @test ) + ret i32 %two2 -int "test"(int %i0) -begin - ret int %i0 -end +Error: ; preds = %0 + ret i32 -1 +} + +define i32 @test(i32 %i0) { + ret i32 %i0 +}