blob: 090e840007e37395de37bc3fec31582990dce3d4 [file] [log] [blame]
Reid Spencer69ccadd2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
Tanya Lattner3f7706b2004-11-07 06:08:43 +00002; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Chris Lattner49ca7aa2001-10-13 07:05:07 +00005%FunTy = type int(int)
6
7declare int "test"(...) ; Test differences of prototype
8declare int "test"() ; Differ only by vararg
9
Chris Lattner00950542001-06-06 20:29:01 +000010implementation
11
Chris Lattnerd100d4c2005-05-06 06:18:33 +000012void "invoke"(%FunTy *%x) {
Chris Lattner49ca7aa2001-10-13 07:05:07 +000013 %foo = call %FunTy* %x(int 123)
Chris Lattnerd100d4c2005-05-06 06:18:33 +000014 %foo2 = tail call %FunTy* %x(int 123)
Chris Lattner49ca7aa2001-10-13 07:05:07 +000015 ret void
Chris Lattnerd100d4c2005-05-06 06:18:33 +000016}
Chris Lattner00950542001-06-06 20:29:01 +000017
18int "main"(int %argc) ; TODO: , sbyte **argv, sbyte **envp)
19begin
Chris Lattnerda257162001-10-03 14:50:12 +000020 %retval = call int (int) *%test(int %argc)
Chris Lattner00950542001-06-06 20:29:01 +000021 %two = add int %retval, %retval
Chris Lattner49ca7aa2001-10-13 07:05:07 +000022 %retval2 = invoke int %test(int %argc)
23 to label %Next except label %Error
24Next:
25 %two2 = add int %two, %retval2
26 call void %invoke (%FunTy* %test)
27 ret int %two2
28Error:
29 ret int -1
Chris Lattner00950542001-06-06 20:29:01 +000030end
31
32int "test"(int %i0)
33begin
34 ret int %i0
35end