; Instcombine was missing a test that caused it to make illegal transformations
; sometimes. In this case, it transforms the sub into an add:
; RUN: echo foo
-; RUN: if as < %s | opt -instcombine | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not add
;
-; RUN: if as < %s | opt -instcombine | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not add
int %test(int %A) {
%A.neg = sub int 0, %A
; This also tests that a subtract with a constant is properly converted
; to a add w/negative constant
-; RUN: if as < %s | opt -instcombine -die | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine -die | dis | grep-not add
implementation
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine | dis | grep and
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not and
implementation
-; RUN: if as < %s | opt -instcombine -die | dis | grep call | grep cast
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine -die | dis | grep call | grep-not cast
implementation
; slow. Might it be better to make there be an instcombine prepass before
; level raise that takes care of the obvious stuff?
-; RUN: if as < %s | opt -instcombine | dis | grep cast
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not cast
bool %test1(int %X) {
%A = cast int %X to uint
; 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: as < %s | opt -instcombine -die | dis | grep '%c' | grep-not cast
implementation
; This test makes sure that div instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine | dis | grep div
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not div
implementation
; The %A getelementptr instruction should be eliminated here
-; RUN: if as < %s | opt -instcombine -die | dis | grep getelementptr | grep '%A '
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine -die | dis | grep getelementptr | grep-not '%A '
%Global = constant [10 x sbyte] c"helloworld"
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine | dis | grep load
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not load
%X = constant int 42
%Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 },
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine -die | dis | grep xor
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine -die | dis | grep-not xor
implementation
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine | dis | grep -v '%OROK = or' | grep or\
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep -v '%OROK = or' | grep-not 'or '
implementation
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine -die | dis | grep phi
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine -die | dis | grep-not phi
implementation
;
; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html
-; RUN: if as < %s | opt -instcombine | dis | grep 'call double %pow'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not 'call double %pow'
declare double %pow(double, double)
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine | dis | grep rem
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not rem
implementation
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine | dis | grep set
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not set
%X = uninitialized global int
; into equivalent setne,eq instructions.
;
-; RUN: if as < %s | opt -instcombine | dis | grep -v seteq | grep -v setne | grep set
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep -v seteq | grep -v setne | grep-not set
bool "test1"(uint %A) {
%B = setge uint %A, 1 ; setne %A, 0
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine | dis | grep sh
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine | dis | grep-not sh
implementation
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: if as < %s | opt -instcombine -die | dis | grep sub | grep -v 'sub int %Cok, %Bok'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -instcombine -die | dis | grep sub | grep-not -v 'sub int %Cok, %Bok'
implementation