blob: f015223c5d75acc528b219579303be9b92bad1bb [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | 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
7declare int "test"(int) ; Test forward declaration merging
8
9implementation
10
11void "invoke"(%FunTy *%x) {
12 %foo = call %FunTy* %x(int 123)
13 %foo2 = tail call %FunTy* %x(int 123)
14 ret void
15}
16
17int "main"(int %argc) ; TODO: , sbyte **argv, sbyte **envp)
18begin
19 %retval = call int (int) *%test(int %argc)
20 %two = add int %retval, %retval
21 %retval2 = invoke int %test(int %argc)
22 to label %Next except label %Error
23Next:
24 %two2 = add int %two, %retval2
25 call void %invoke (%FunTy* %test)
26 ret int %two2
27Error:
28 ret int -1
29end
30
31int "test"(int %i0)
32begin
33 ret int %i0
34end