blob: e7d8e8d00b3c5f8bde5cd6f6d9b1036c2abcb487 [file] [log] [blame]
Tanya Lattnerb7e02fc2008-03-01 07:38:40 +00001; RUN: llvm-as < %s | llvm-dis > %t1.ll
Tanya Lattner84f7fda2004-11-07 06:08:43 +00002; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Tanya Lattnerb7e02fc2008-03-01 07:38:40 +00005%FunTy = type i32 (i32)
Chris Lattnerdcd96762001-10-13 07:05:07 +00006
Tanya Lattnerb7e02fc2008-03-01 07:38:40 +00007define void @invoke(%FunTy* %x) {
Bill Wendlingff209172011-08-25 01:30:18 +00008 %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
9 %foo2 = tail call i32 %x( i32 123 ) ; <i32> [#uses=0]
10 ret void
Chris Lattner2c9a46e2005-05-06 06:18:33 +000011}
Chris Lattner2f7c9632001-06-06 20:29:01 +000012
Tanya Lattnerb7e02fc2008-03-01 07:38:40 +000013define i32 @main(i32 %argc) {
Bill Wendlingff209172011-08-25 01:30:18 +000014 %retval = call i32 @test( i32 %argc ) ; <i32> [#uses=2]
15 %two = add i32 %retval, %retval ; <i32> [#uses=1]
16 %retval2 = invoke i32 @test( i32 %argc )
17 to label %Next unwind label %Error ; <i32> [#uses=1]
Chris Lattner2f7c9632001-06-06 20:29:01 +000018
Bill Wendlingff209172011-08-25 01:30:18 +000019Next:
20 %two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
21 call void @invoke( %FunTy* @test )
22 ret i32 %two2
Tanya Lattnerb7e02fc2008-03-01 07:38:40 +000023
Bill Wendlingff209172011-08-25 01:30:18 +000024Error:
25 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
26 cleanup
27 ret i32 -1
Tanya Lattnerb7e02fc2008-03-01 07:38:40 +000028}
29
30define i32 @test(i32 %i0) {
31 ret i32 %i0
32}
Bill Wendlingff209172011-08-25 01:30:18 +000033
34declare i32 @__gxx_personality_v0(...)