; Tests to make sure elimination of casts is working correctly
-; RUN: if as < %s | opt -instcombine -die | dis | grep '%c' | grep cast
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep '%c' | not grep cast
implementation
ret short %c2
}
-bool %test11(ubyte %A, ubyte %B) {
- %C = sub ubyte %A, %B
- %D = cast ubyte %C to bool ; == setne A, B
- ret bool %D
-}
-
-bool %test12(ubyte %A) {
- %B = add ubyte %A, 255
- %C = cast ubyte %B to bool ; === A != 1
- ret bool %C
-}
+declare void %varargs(int, ...)
-bool %test13(ubyte %A, ubyte %b) {
- %B = add ubyte %A, %b
- %C = cast ubyte %B to bool ; === A != 1
- ret bool %C
+void %test11(int* %P) {
+ %c = cast int* %P to short*
+ call void(int, ...)* %varargs(int 5, short* %c)
+ ret void
}
-