1 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep call | not grep cast
5 ; Simple case, argument translatable without changing the value
6 declare void %test1a(sbyte *%A)
8 call void(int*)* cast (void(sbyte*)* %test1a to void(int*)*)(int* %A)
12 ; More complex case, translate argument because of resolution. This is safe
13 ; because we have the body of the function
14 void %test2a(sbyte %A) { ret void }
16 call void(int)* cast (void(sbyte)* %test2a to void(int)*)(int %A)
20 ; Resolving this should insert a cast from sbyte to int, following the C
22 declare void %test3a(sbyte %A, ...)
23 void %test3(sbyte %A, sbyte %B) {
24 call void(sbyte, sbyte)* cast (void(sbyte,...)* %test3a to void(sbyte,sbyte)*)(sbyte %A, sbyte %B)
28 ; test conversion of return value...
29 sbyte %test4a() { ret sbyte 0 }
31 %X = call int()* cast (sbyte()* %test4a to int()*)()
35 ; test conversion of return value... no value conversion occurs so we can do
36 ; this with just a prototype...
37 declare uint %test5a()
39 %X = call int()* cast (uint()* %test5a to int()*)()
43 ; test addition of new arguments...
44 declare int %test6a(int %X)
46 %X = call int()* cast (int(int)* %test6a to int()*)()
50 ; test removal of arguments, only can happen with a function body
51 void %test7a() { ret void }
53 call void(int)* cast (void()* %test7a to void(int)*)(int 5)