1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
2 ; RUN: grep call | notcast
7 ; Simple case, argument translatable without changing the value
8 declare void %test1a(sbyte *%A)
10 call void(int*)* cast (void(sbyte*)* %test1a to void(int*)*)(int* %A)
14 ; More complex case, translate argument because of resolution. This is safe
15 ; because we have the body of the function
16 void %test2a(sbyte %A) { ret void }
18 call void(int)* cast (void(sbyte)* %test2a to void(int)*)(int %A)
22 ; Resolving this should insert a cast from sbyte to int, following the C
24 declare void %test3a(sbyte %A, ...)
25 void %test3(sbyte %A, sbyte %B) {
26 call void(sbyte, sbyte)* cast (void(sbyte,...)* %test3a to void(sbyte,sbyte)*)(sbyte %A, sbyte %B)
30 ; test conversion of return value...
31 sbyte %test4a() { ret sbyte 0 }
33 %X = call int()* cast (sbyte()* %test4a to int()*)()
37 ; test conversion of return value... no value conversion occurs so we can do
38 ; this with just a prototype...
39 declare uint %test5a()
41 %X = call int()* cast (uint()* %test5a to int()*)()
45 ; test addition of new arguments...
46 declare int %test6a(int %X)
48 %X = call int()* cast (int(int)* %test6a to int()*)()
52 ; test removal of arguments, only can happen with a function body
53 void %test7a() { ret void }
55 call void(int)* cast (void()* %test7a to void(int)*)(int 5)