yea yea yea
[oota-llvm.git] / test / Feature / calltest.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 int(int)
6
7 declare int "test"(...)   ; Test differences of prototype
8 declare int "test"()      ; Differ only by vararg
9
10 implementation
11
12 void "invoke"(%FunTy *%x)
13 begin
14         %foo = call %FunTy* %x(int 123)
15         ret void
16 end
17
18 int "main"(int %argc)   ; TODO: , sbyte **argv, sbyte **envp)
19 begin
20         %retval = call int (int) *%test(int %argc)
21         %two    = add int %retval, %retval
22         %retval2 = invoke int %test(int %argc)
23                    to label %Next except label %Error
24 Next:
25         %two2 = add int %two, %retval2
26         call void %invoke (%FunTy* %test)
27         ret int %two2
28 Error:
29         ret int -1
30 end
31
32 int "test"(int %i0)
33 begin
34     ret int %i0
35 end