X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FFeature%2Fcalltest.ll;h=e7d8e8d00b3c5f8bde5cd6f6d9b1036c2abcb487;hb=fef904d0e824a2c587f8c1063b6c4fbf47fec898;hp=8adbe4937180312c716cfd77705d0a542dbf9c5c;hpb=3f7706b5d23aca56a6d3a62ebb9466e1e89335f7;p=oota-llvm.git diff --git a/test/Feature/calltest.ll b/test/Feature/calltest.ll index 8adbe493718..e7d8e8d00b3 100644 --- a/test/Feature/calltest.ll +++ b/test/Feature/calltest.ll @@ -1,35 +1,34 @@ -; RUN: llvm-as %s -o - | 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"(...) ; Test differences of prototype -declare int "test"() ; Differ only by vararg +define void @invoke(%FunTy* %x) { + %foo = call i32 %x( i32 123 ) ; [#uses=0] + %foo2 = tail call i32 %x( i32 123 ) ; [#uses=0] + ret void +} -implementation +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] -void "invoke"(%FunTy *%x) -begin - %foo = call %FunTy* %x(int 123) - ret void -end - -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 + %two2 = add i32 %two, %retval2 ; [#uses=1] + call void @invoke( %FunTy* @test ) + ret i32 %two2 + Error: - ret int -1 -end + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + ret i32 -1 +} + +define i32 @test(i32 %i0) { + ret i32 %i0 +} -int "test"(int %i0) -begin - ret int %i0 -end +declare i32 @__gxx_personality_v0(...)