c4a7f63fe4ccc634f0145a795402c5c0db73e587
[oota-llvm.git] / test / Integer / calltest_bt.ll
1 ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3 ; RUN: diff %t1.ll %t2.ll
4
5 %FunTy = type i28(i28)
6
7 declare i28 @"test"(...)   ; Test differences of prototype
8 declare i28 @"test"()      ; Differ only by vararg
9
10 implementation
11
12 define void @"invoke"(%FunTy *%x) {
13         %foo = call %FunTy* %x(i28 123)
14         %foo2 = tail call %FunTy* %x(i28 123)
15         ret void
16 }
17
18 define i28 @"main"(i28 %argc)   ; TODO: , sbyte **argv, sbyte **envp)
19 begin
20         %retval = call i28 (i28) *@test(i28 %argc)
21         %two    = add i28 %retval, %retval
22         %retval2 = invoke i28 @test(i28 %argc)
23                    to label %Next unwind label %Error
24 Next:
25         %two2 = add i28 %two, %retval2
26         call void @invoke (%FunTy* @test)
27         ret i28 %two2
28 Error:
29         ret i28 -1
30 end
31
32 define i28 @"test"(i28 %i0) {
33     ret i28 %i0
34 }