2001-10-13 09:05:07 +02:00
|
|
|
%FunTy = type int(int)
|
|
|
|
|
|
|
|
declare int "test"(...) ; Test differences of prototype
|
|
|
|
declare int "test"() ; Differ only by vararg
|
|
|
|
|
2001-06-06 22:29:01 +02:00
|
|
|
implementation
|
|
|
|
|
2001-10-13 09:05:07 +02:00
|
|
|
void "invoke"(%FunTy *%x)
|
|
|
|
begin
|
|
|
|
%foo = call %FunTy* %x(int 123)
|
|
|
|
ret void
|
|
|
|
end
|
2001-06-06 22:29:01 +02:00
|
|
|
|
|
|
|
int "main"(int %argc) ; TODO: , sbyte **argv, sbyte **envp)
|
|
|
|
begin
|
2001-10-03 16:50:12 +02:00
|
|
|
%retval = call int (int) *%test(int %argc)
|
2001-06-06 22:29:01 +02:00
|
|
|
%two = add int %retval, %retval
|
2001-10-13 09:05:07 +02:00
|
|
|
%retval2 = invoke int %test(int %argc)
|
|
|
|
to label %Next except label %Error
|
|
|
|
Next:
|
|
|
|
%two2 = add int %two, %retval2
|
|
|
|
call void %invoke (%FunTy* %test)
|
|
|
|
ret int %two2
|
|
|
|
Error:
|
|
|
|
ret int -1
|
2001-06-06 22:29:01 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
int "test"(int %i0)
|
|
|
|
begin
|
|
|
|
ret int %i0
|
|
|
|
end
|