Remove explicit control flow through the use of the 'not' script
authorChris Lattner <sabre@nondot.org>
Sat, 28 Jun 2003 23:23:34 +0000 (23:23 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Jun 2003 23:23:34 +0000 (23:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6965 91177308-0d34-0410-b5e6-96231b3b80d8

65 files changed:
test/Analysis/BasicAA/featuretest.ll
test/Analysis/BasicAA/gcsetest.ll
test/Analysis/BasicAA/licmtest.ll
test/Analysis/DSGraph/gcsetest.ll
test/Analysis/LoadVN/RLE-Eliminate.ll
test/Assembler/2002-04-29-NameBinding.llx
test/Assembler/ConstantExprFoldCast.llx
test/Linker/2003-05-31-LinkerRename.ll
test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll
test/Transforms/ADCE/adcetest.ll
test/Transforms/BasicAA/featuretest.ll
test/Transforms/BasicAA/gcsetest.ll
test/Transforms/BasicAA/licmtest.ll
test/Transforms/ConstProp/2002-05-03-NotOperator.ll
test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll
test/Transforms/ConstProp/basictest.ll
test/Transforms/ConstProp/logicaltest.ll
test/Transforms/ConstProp/nottest.ll
test/Transforms/ConstProp/phi.ll
test/Transforms/ConstProp/remtest.ll
test/Transforms/CorrelatedExprs/2002-10-03-PHIPropogate.ll
test/Transforms/CorrelatedExprs/basictest.ll
test/Transforms/CorrelatedExprs/branchtest.ll
test/Transforms/CorrelatedExprs/looptest.ll
test/Transforms/CorrelatedExprs/nullpointer.ll
test/Transforms/CorrelatedExprs/whet.ll
test/Transforms/DeadArgElim/basictest.ll
test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll
test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVarsEasier.ll
test/Transforms/FunctionResolve/2002-11-07-RetMismatch.ll
test/Transforms/FunctionResolve/2002-11-09-ExternFn.ll
test/Transforms/FunctionResolve/2003-04-18-ForwardDeclGlobal.ll
test/Transforms/FunctionResolve/2003-05-31-AllInternalDecls.ll
test/Transforms/FunctionResolve/2003-05-31-FuncPointerResolve.ll
test/Transforms/FunctionResolve/2003-05-31-InternalDecl.ll
test/Transforms/FunctionResolve/basictest.ll
test/Transforms/FunctionResolve/retmismatch1.ll
test/Transforms/FunctionResolve/retmismatch2.ll
test/Transforms/GCSE/2002-05-14-OperandSwap.ll
test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll
test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
test/Transforms/GlobalDCE/basicvariabletest.ll
test/Transforms/LICM/2003-02-27-PreheaderProblem.ll
test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll
test/Transforms/Mem2Reg/DifferingTypes.ll
test/Transforms/Mem2Reg/PromoteMemToRegister.ll
test/Transforms/PiNodeInserter/substitutetest.ll
test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll
test/Transforms/Reassociate/2002-05-15-MissedTree.ll
test/Transforms/Reassociate/2002-05-15-SubReassociate.ll
test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll
test/Transforms/Reassociate/basictest.ll
test/Transforms/Reassociate/basictest2.ll
test/Transforms/Reassociate/looptest.ll
test/Transforms/Reassociate/otherops.ll
test/Transforms/Reassociate/subtest.ll
test/Transforms/SCCP/2002-05-02-EdgeFailure.ll
test/Transforms/SCCP/2002-05-02-MissSecondInst.ll
test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll
test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll
test/Transforms/SCCP/basictest.ll
test/Transforms/SCCP/sccptest.ll
test/Transforms/ScalarRepl/arraytest.ll
test/Transforms/ScalarRepl/basictest.ll

index 803dafb676861029194da8bb5740f4d8940811b7..0b798e2b635e1dba905f60946cef4018e43352fa 100644 (file)
@@ -1,10 +1,7 @@
 ; This testcase tests for various features the basicaa test should be able to 
 ; determine, as noted in the comments.
 
-; RUN: if as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | grep REMOVE
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep REMOVE
 
 %Global = external global { int }
 
index 67556639470cef9eaba3fdf62b3e5b47baace774..4287e7d27820ebf9a88942fa1f897a56dddc59b3 100644 (file)
@@ -2,10 +2,7 @@
 ; disambiguating some obvious cases.  All loads should be removable in 
 ; this testcase.
 
-; RUN: if as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | grep load
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep load
 
 %A = global int 7
 %B = global int 8
index 585ac17ae92d482ccf568a16e997091bbeb65439..414a538085334ac24c20e028c55b24341c87568b 100644 (file)
@@ -3,10 +3,7 @@
 ; two pointers, then the load should be hoisted, and the store sunk.  Thus
 ; the loop becomes empty and can be deleted by ADCE. 
 
-; RUN: if as < %s | opt -basicaa -licm --adce | dis | grep Loop
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -basicaa -licm --adce | dis | not grep Loop
 
 %A = global int 7
 %B = global int 8
index 14a07bf87b035c475a33f25de752f3d07a98669b..bf0cc354bde947da1e2d4967e3334e0aeda43b42 100644 (file)
@@ -1,10 +1,7 @@
 ; Test that GCSE uses ds-aa to do alias analysis, which is capable of 
 ; disambiguating some cases.
 
-; RUN: if as < %s | opt -ds-aa -load-vn -gcse -instcombine -dce | dis | grep ELIM
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -ds-aa -load-vn -gcse -instcombine -dce | dis | not grep ELIM
 
 %intpair = type {int*, int*}
 implementation
index 3abfc19b8534033dbd700edb4c5f047585e339fe..fb79cfa7fd711a00811fc7b58360979bf617ebad 100644 (file)
@@ -1,10 +1,7 @@
 ; This testcase ensures that redundant loads are eliminated when they should 
 ; be.  All RL variables (redundant loads) should be eliminated.
 ;
-; RUN: if as < %s | opt -load-vn -gcse | dis | grep %RL
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -load-vn -gcse | dis | not grep %RL
 ;
 int "test1"(int* %P) {
        %A = load int* %P
index 4550832453ced073d3044e8cab295be7eb66c516..c1e6aba5e05e21bb1dae5758112953e029af9a60 100644 (file)
@@ -4,10 +4,7 @@
 ; Check by running globaldce, which will remove the constant if there are
 ; no references to it!
 ; 
-; RUN: if as < %s | opt -globaldce | dis | grep constant
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -globaldce | dis | grep-not constant
 ;
        
 %v1 = internal constant int 5
@@ -15,7 +12,6 @@
 implementation
 
 int "createtask"()
-begin
        %v1 = alloca int           ;; Alloca should have one use!
        %reg112 = load int* %v1    ;; This load should not use the global!
        ret int %reg112
index 38763a7306fb232348431818326740543ec8fc14..34e5654b858906071729a56754e7dee96f7ad8bd 100644 (file)
@@ -1,9 +1,6 @@
 ; This test checks to make sure that constant exprs fold in some simple situations
 
-; RUN: if as < %s | dis | grep cast
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | dis | grep-not cast
 
 %A = global int* cast (sbyte* null to int*)  ; Cast null -> fold
 %B = global int** cast (int** %A to int**)   ; Cast to same type -> fold
index b1ba4b0b907be163168366ec1b3712dfc5025447..b3e4b8ef3fcbc390bc7b6af9aa5adcb7786535b8 100644 (file)
@@ -5,10 +5,7 @@
 
 ; RUN: echo "implementation internal int %foo() { ret int 7 }" | as > Output/%s.1.bc
 ; RUN: as < %s > Output/%s.2.bc
-; RUN: if link Output/%s.[12].bc | dis | grep 'internal' | grep '%foo('
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: link Output/%s.[12].bc | dis | grep 'internal' | grep-not '%foo('
 
 implementation
 declare int %foo() 
index 453723b1258ed9087fbb491d3e5f6af59e3c2758..7e4bf080907cd4028de1baa616dca2c70bc56e9f 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -adce -simplifycfg | dis | grep then:
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -adce -simplifycfg | dis | not grep then:
 
 void %dead_test8(int* %data.1, int %idx.1) {
 entry:         ; No predecessors!
index 4a06cd9f396ff0fa2005306e7de1f5df80e6e774..2e9cd6c6c380f3edc59be02b82698df41116ee20 100644 (file)
@@ -1,10 +1,7 @@
 ; This is the test case taken from Appel's book that illustrates a hard case
 ; that SCCP gets right, and when followed by ADCE, is completely eliminated
 ;
-; RUN: if as < %s | opt -sccp -adce -simplifycfg | dis | grep br
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -sccp -adce -simplifycfg | dis | not grep br
 
 int "test function"(int %i0, int %j0) {
 BB1:
index 803dafb676861029194da8bb5740f4d8940811b7..0b798e2b635e1dba905f60946cef4018e43352fa 100644 (file)
@@ -1,10 +1,7 @@
 ; This testcase tests for various features the basicaa test should be able to 
 ; determine, as noted in the comments.
 
-; RUN: if as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | grep REMOVE
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep REMOVE
 
 %Global = external global { int }
 
index 67556639470cef9eaba3fdf62b3e5b47baace774..4287e7d27820ebf9a88942fa1f897a56dddc59b3 100644 (file)
@@ -2,10 +2,7 @@
 ; disambiguating some obvious cases.  All loads should be removable in 
 ; this testcase.
 
-; RUN: if as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | grep load
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep load
 
 %A = global int 7
 %B = global int 8
index 585ac17ae92d482ccf568a16e997091bbeb65439..414a538085334ac24c20e028c55b24341c87568b 100644 (file)
@@ -3,10 +3,7 @@
 ; two pointers, then the load should be hoisted, and the store sunk.  Thus
 ; the loop becomes empty and can be deleted by ADCE. 
 
-; RUN: if as < %s | opt -basicaa -licm --adce | dis | grep Loop
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -basicaa -licm --adce | dis | not grep Loop
 
 %A = global int 7
 %B = global int 8
index cbc1b6c6c8bfda8fe60188b7b0a0d3e96a5b2296..d184c08c073da00c3e46082314a67c2388ec69a3 100644 (file)
@@ -4,10 +4,7 @@
 
 ; Fix #2: The unary not instruction now no longer exists. Change to xor.
 
-; RUN: if as < %s | opt -constprop | dis | grep 'int 0'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -constprop | dis | not grep 'int 0'
 
 int "test1"() {
        %R = xor int 123, -1
index 9ac493537736137fcd5ebd083cbb71e89807622d..ec73c057f06c383b4d894eadad019e949266381e 100644 (file)
@@ -1,9 +1,6 @@
 ; SetCC on boolean values was not implemented!
 
-; RUN: if as < %s | opt -constprop -die | dis | grep 'set'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -constprop -die | dis | not grep 'set'
 
 bool "test1"() {
        %A = setle bool true, false
index 65cfd35889ea094d3261a88580787ec449cb9327..8fe5ebb7c5e8ed6df31c46ad4fe50f98cfce0e98 100644 (file)
@@ -1,13 +1,9 @@
 ; This is a basic sanity check for constant propogation.  The add instruction 
 ; should be eliminated.
 
-; RUN: if as < %s | opt -constprop -die | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -constprop -die | dis | not grep add
 
-int "test"(bool %B)
-begin
+int %test(bool %B) {
        br bool %B, label %BB1, label %BB2
 BB1:
        %Val = add int 0, 0
@@ -17,4 +13,4 @@ BB2:
 BB3:
        %Ret = phi int [%Val, %BB1], [1, %BB2]
        ret int %Ret
-end
+}
index f5af80eb0fcd53dad23610e88331787fe2f5ef16..8e9d4160900603ac62649a7a8f8b81736471e984 100644 (file)
@@ -1,9 +1,6 @@
 ; Ensure constant propogation of logical instructions is working correctly.
 
-; RUN: if as < %s | opt -constprop -die | dis | ggrep -E 'and|or|xor'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -constprop -die | dis | not ggrep -E 'and|or|xor'
 
 
 int  "test1"() { %R = and int 4,1234          ret int  %R }
index a74d5148994837302612861151defee0d5f1cc57..11dc63ecd0767a7a1a34a6e4a38524bea8e58651 100644 (file)
@@ -1,9 +1,6 @@
 ; Ensure constant propogation of 'not' instructions is working correctly.
 
-; RUN: if as < %s | opt -constprop -die | dis | grep xor
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -constprop -die | dis | not grep xor
 
 int "test1"() {
        %R = xor int 4, -1
index 064b681c5cf3abef935b34b5f406487b445eb951..c80c5e4bb5fad7c7cd50b37f4d8e3cce91b49952 100644 (file)
@@ -1,13 +1,9 @@
 ; This is a basic sanity check for constant propogation.  The add instruction 
 ; should be eliminated.
 
-; RUN: if as < %s | opt -constprop -die | dis | grep phi
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -constprop -die | dis | not grep phi
 
-int "test"(bool %B)
-begin
+int %test(bool %B) {
 BB0:
        br bool %B, label %BB1, label %BB3
 BB1:
@@ -15,4 +11,4 @@ BB1:
 BB3:
        %Ret = phi int [1, %BB0], [1, %BB1]
        ret int %Ret
-end
+}
index d3be9350edc070b3a3887fb79cf182d1bb48d048..7ff310898c8a317fbf307192ab9b1dd06f66a96b 100644 (file)
@@ -1,26 +1,23 @@
-; Ensure constant propogation of remainder instructions is working correctly.
+; Ensure constant propagation of remainder instructions is working correctly.
 
-; RUN: if as < %s | opt -constprop -die | dis | grep rem
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -constprop -die | dis | not grep rem
 
-int "test1"() {
+int %test1() {
        %R = rem int 4, 3
        ret int %R
 }
 
-int "test2"() {
+int %test2() {
        %R = rem int 123, -23
        ret int %R
 }
 
-float "test3"() {
+float %test3() {
        %R = rem float 12.45, 123.213
        ret float %R
 }
 
-double "test4"() {
+double %test4() {
        %R = rem double 312.20213123, 12.3333412
        ret double %R
 }
index 73f439988e55a98cf2cfa4e089cad63d74601455..d1bb4303f990589fccd23e0a5e19f3747aacd708 100644 (file)
 ;   }
 ; }
 ;
-; RUN: if as < %s | opt -cee -simplifycfg | dis | grep bb3
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -cee -simplifycfg | dis | not grep bb3
 
 implementation
 declare void %bar()
index c8eb546b5e7f24d2df309effa17682dad09d03db..d5b260984e06d58384699911461ade8aa5d392f6 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -cee -constprop -instcombine -dce | dis | grep 'REMOVE'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -cee -constprop -instcombine -dce | dis | not grep 'REMOVE'
 
 int %test1(int %A) {
        %cond = seteq int %A, 40
index eeed1fd5a205fd6fbd9f86e5bcd88bbb13076d90..c431cb4c03ab38e778a56963bed62c77be1f4edd 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -cee -simplifycfg | dis | grep 'REMOVE'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -cee -simplifycfg | dis | not grep 'REMOVE'
 
 implementation
 
index 3af0814eea6169d00bca21d8b88a18a4b44394d8..6763443291bacd99e0b9c7a41baa05f5b7a6d077 100644 (file)
 ;
 ; Note that this is a "feature" test, not a correctness test.
 ;
-; RUN: if as < %s | opt -cee -simplifycfg | dis | grep cond213
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -cee -simplifycfg | dis | not grep cond213
 ;
 implementation   ; Functions:
 
index cf2245d09cb34ca538821eba2a16a0479bcb51db..ff4a3bd658f80ded6c88c7c6208e0dfade7df7b5 100644 (file)
@@ -1,10 +1,7 @@
 ; a load or store of a pointer indicates that the pointer is not null.
 ; Any succeeding uses of the pointer should get this info
 
-; RUN: if as < %s | opt -cee -instcombine -simplifycfg | dis | grep br
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -cee -instcombine -simplifycfg | dis | not grep br
 
 implementation   ; Functions:
 
index c1e92f8e6f13d1cac0e624330c3660486da93e3c..b2ce0915680c2f31c79a94204cd5cc9af85977a0 100644 (file)
 ;
 ; This should eliminate all BB's except BB0, BB9, BB10
 ;
-; RUN: if as < %s | opt -cee -instcombine -simplifycfg | dis | grep 'bb[2-8]'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -cee -instcombine -simplifycfg | dis | not grep 'bb[2-8]'
 
 implementation   ; Functions:
 
index 77701f7361b12df1bbd098ed62ce453143ff150e..d43d577305bde74eaa509b697b847cff2c6d5581 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -deadargelim | dis | grep DEADARG
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -deadargelim | dis | not grep DEADARG
 
 implementation
 
index 3eb61d41a41a998b988a16ef71eb03ade49f2ac3..54bc68812f321df933d2255ea4d4f9f33e6bd42b 100644 (file)
@@ -1,16 +1,7 @@
 ; Test that: extern int X[]  and int X[] = { 1, 2, 3, 4 } are resolved 
 ; correctly.
 ;
-; RUN: if as < %s | opt -funcresolve > /dev/null
-; RUN: then echo "opt ok"
-; RUN: else exit 1   # Make sure opt doesn't abort!
-; RUN: fi
-;
-; RUN: if as < %s | opt -funcresolve | dis | grep external
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
-;
+; RUN: as < %s | opt -funcresolve | dis | not grep external
 
 %X = external global [0 x int]
 %X = global [4 x int] [ int 1, int 2, int 3, int 4 ]
index 39c9a3dec7d005a999e7bf127df07576de753ac3..993fd88516ca00fd60fa0b2dfe8071ea5ff31191 100644 (file)
@@ -1,10 +1,7 @@
 ; Test that: extern int X[]  and int X[] = { 1, 2, 3, 4 } are resolved 
 ; correctly.  This doesn't have constantexprs
 ;
-; RUN: if as < %s | opt -funcresolve | dis | grep external
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve | dis | not grep external
 ;
 
 %X = external global [0 x int]
index 468b6874d7cdf49da024888ff00796f9a00410dc..15a09ab0fb189fe9bd0ca6f75ddc720866a97995 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -funcresolve -funcresolve | dis | grep declare
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve -funcresolve | dis | not grep declare
 
 declare void %qsortg(sbyte*, int, int)
 
index a0dab65b4e4f06baaa699370a8b4b15f82884e00..69092194a82ee6465324efbe58ad8c89f81f7e45 100644 (file)
@@ -1,12 +1,5 @@
-; RUN: if as < %s | opt -funcresolve > /dev/null
-; RUN: then echo "opt ok"
-; RUN: else exit 1   # Make sure opt doesn't abort!
-; RUN: fi
 ;
-; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve -instcombine | dis | not grep '\.\.\.'
 
 declare int %foo(...)
 declare int %foo(int)
index fd25eae903804814ea2393c82ae24aea0cbe448c..a9c4117cee519c8aaab6f0abf3e5adbd53971e04 100644 (file)
@@ -1,7 +1,5 @@
-; RUN: if as < %s | opt -funcresolve -disable-output 2>&1 | grep WARNING
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve -disable-output 2>&1 | not grep WARNING
+
 %__popcount_tab = external constant [0 x ubyte]
 %__popcount_tab = constant [4 x ubyte] c"\00\01\01\02"
 
index 88d6775b999cd2ed99e446c62cae29bdf7961f0b..7abf0c2ce49fe404441ef4503fbe53579d8d098c 100644 (file)
@@ -1,9 +1,6 @@
 ; This testcase should not cause a warning!
 
-; RUN: if (as < %s | opt -funcresolve -disable-output) 2>&1 | grep 'WARNING'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: (as < %s | opt -funcresolve -disable-output) 2>&1 | not grep 'WARNING'
 
 %X = internal global float 1.0
 %X = internal global int 1
index c171b184e73b8589085d8bdbdb4155c11f5139bd..01da6dc9a63ba06b361f9835277ffed99c76a22b 100644 (file)
@@ -1,7 +1,5 @@
-; RUN: if as < %s | opt -funcresolve | dis | grep declare
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve | dis | not grep declare
+
 %Table = constant int(...)* %foo
 
 %Table2 = constant [1 x int(...)* ] [ int(...)* %foo ]
index ab41e2ec821854f3cfa7b96e365e6e6c9b951fc0..41cad05a2da3045de0cb7a2248d3d385ee181c67 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -funcresolve | dis | grep declare
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve | dis | not grep declare
 
 declare void %test(...)
 
index 422b655420b091dfbe829bc8ea60f8509766fc73..fa53724dc83fb53a768f079383a43c0fdbcf7ac2 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
 
 declare int %foo(...)
 
index fe684d1235b43c8893f27dbc2eec37ca029eeff1..adbce7304871e0f3dc781e8856f396ebcb429e10 100644 (file)
@@ -1,14 +1,6 @@
 ; This shows where the function is called with the prototype indicating a
 ; return type exists, but it really doesn't.
-; RUN: if as < %s | opt -funcresolve > /dev/null
-; RUN: then echo "opt ok"
-; RUN: else exit 1   # Make sure opt doesn't abort!
-; RUN: fi
-;
-; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
 
 declare int %foo(...)
 
index cffe1a4c9e7d3b419b008f57c6a6f5b3dfbb97cb..36a062eb28b06bbea0d577e67ee016ccb94d6c75 100644 (file)
@@ -1,15 +1,7 @@
 ; This shows where the function is called with the prototype indicating a
 ; return type doesn't exists, but it really does.
 ;
-; RUN: if as < %s | opt -funcresolve > /dev/null
-; RUN: then echo "opt ok"
-; RUN: else exit 1   # Make sure opt doesn't abort!
-; RUN: fi
-;
-; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
 
 declare void %foo(...)
 
index 22296e344e7329ee7f706c2b7186a7d3b2e51972..57ac538172957ab28253a7c1e25d974bfbb9605f 100644 (file)
@@ -1,10 +1,7 @@
 ; This entire chain of computation should be optimized away, but
 ; wasn't because the two multiplies were not detected as being identical.
 ;
-; RUN: if as < %s  | opt -gcse -instcombine -dce | dis | grep sub
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s  | opt -gcse -instcombine -dce | dis | not grep sub
 
 implementation   ; Functions:
 
index 77a087a591c5f5465735b7037eb6f728c4638483..fa83e2d5de9f82af312838e3807f2a7cd552d63d 100644 (file)
@@ -1,10 +1,7 @@
 ; This testcase shows a bug where an common subexpression exists, but there
 ; is no shared dominator block that the expression can be hoisted out to.
 ;
-; RUN: if as < %s | opt -load-vn -gcse | dis | grep load
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -load-vn -gcse | dis | not grep load
 
 int %test(int* %P) {
        store int 5, int* %P
index 57ed72a93dcd95bcb2523476d9aff2f013022327..a923eb3441223962454d72f45d1e0485164b5ece 100644 (file)
@@ -1,10 +1,7 @@
 ; Make sure that functions are removed successfully if they are referred to by
 ; a global that is dead.  Make sure any globals they refer to die as well.
 
-; RUN: if as < %s | opt -globaldce | dis | grep foo
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -globaldce | dis | not grep foo
 
 %b = internal global int ()* %foo   ;; Unused, kills %foo
 
index b969424cb11468e63a47d965a3abd70b95c016a6..039d597b8c29c3768ee14619c820034733501d48 100644 (file)
@@ -1,10 +1,7 @@
 ; This testcase tests that a worklist is being used, and that globals can be 
 ; removed if they are the subject of a constexpr and ConstantPointerRef
 
-; RUN: if as < %s | opt -globaldce | dis | grep global
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -globaldce | dis | not grep global
 
 %t0 = internal global [4 x sbyte] c"foo\00"
 %t1 = internal global [4 x sbyte] c"bar\00"
index a3d65c79f4b3ad408f60a4ebb318ad68f60ad0ba..1f5c61b66efe5da804a8a35543ad05a5355495b8 100644 (file)
@@ -1,8 +1,4 @@
-; RUN: if as < %s | opt -globaldce | dis | grep global
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
-
+; RUN: as < %s | opt -globaldce | dis | not grep global
 
 %X = uninitialized global int
 %Y = internal global int 7
index cf3e022ab13e71a6b84d92443e909109a902121d..d7290e6090c6dd365131314910824cd56175612d 100644 (file)
@@ -3,10 +3,7 @@
 ; happens because preheader insertion doesn't insert a preheader for this
 ; case... bad.
 
-; RUN: if as < %s | opt -licm -adce -simplifycfg | dis | grep 'br '
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -licm -adce -simplifycfg | dis | not grep 'br '
 
 int %main(int %argc) {
         br label %bb5
index 61145387815f26cadf28df8c4e2e76f52db36a25..f8951509492161b5846374da441568d9b25d8267 100644 (file)
@@ -1,8 +1,5 @@
 ; Promoting some values allows promotion of other values.
-; RUN: if as < %s | opt -mem2reg | dis | grep alloca
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -mem2reg | dis | not grep alloca
 
 int %test2() {
         %result = alloca int             ; ty=int*
index 782deaafc43c4096c6dc8e0fa6db5cf2234a373c..e1069a41b97d90bdf8db34bc21252da791486186 100644 (file)
@@ -2,10 +2,7 @@
 ; generated code should perform the appropriate masking operations required 
 ; depending on the endianness of the target...
 
-; RUN: if as < %s | opt -mem2reg | dis | grep 'alloca'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -mem2reg | dis | not grep 'alloca'
 
 implementation
 
index aacf5bf1f5a95ab34e7df2c58ca77dcafedf74f8..ea30cdb5b8f3ea656a66d814e38caf0976da85ab 100644 (file)
@@ -1,8 +1,5 @@
 ; Simple sanity check testcase.  Both alloca's should be eliminated.
-; RUN: if as < %s | opt -mem2reg | dis | grep 'alloca'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -mem2reg | dis | not grep 'alloca'
 
 implementation
 
index 2c103b995ab405c74c47dc6fce983d582a9de27c..a08a968ea4bbecb9e3c782dc1c7e8739cc2fdb61 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -pinodes -instcombine -die | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -pinodes -instcombine -die | dis | not grep add
 
 int "test"(int %i, int %j) {
        %c = seteq int %i, 0
index 8646ae3cabcb1f0a62ee45505f1f76286b2a4ad3..94785f318fab15dc704f335996cde3b8db9113ff 100644 (file)
@@ -1,9 +1,6 @@
-; RUN: if as < %s | opt -reassociate -instcombine -constprop -dce | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -instcombine -constprop -dce | dis | not grep add
 
-int "test"(int %A) {
+int %test(int %A) {
        %X = add int %A, 1
        %Y = add int %A, 1
        %r = sub int %X, %Y
index 1d08a1054e26651d62f180e88023f9c254fbefd1..4f36c96b364d95c8d9583a272afcca14f5acd9d2 100644 (file)
@@ -1,9 +1,6 @@
-; RUN: if as < %s | opt -reassociate -instcombine -constprop -die | dis | grep 5
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -instcombine -constprop -die | dis | not grep 5
 
-int "test"(int %A, int %B) {
+int %test(int %A, int %B) {
         %W = add int %B, -5
         %Y = add int %A, 5
         %Z = add int %W, %Y
index 7df7bafb2562e4bcb9f659d93c7ac85b67f2ce34..2136e094253e5a89db175e769c1dca452989aa62 100644 (file)
@@ -1,11 +1,8 @@
 ; With sub reassociation, constant folding can eliminate all of the constants.
 ;
-; RUN: if as < %s | opt -reassociate -constprop -instcombine -dce | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -constprop -instcombine -dce | dis | not grep add
 
-int "test"(int %A, int %B) {
+int %test(int %A, int %B) {
        %W = add int 5, %B
        %X = add int -7, %A
        %Y = sub int %X, %W
index aa0066a1ff37cde2559219f9823df8bddb605a81..05f9bd4ae6aef2e61dcdca697a93503237e04812 100644 (file)
@@ -1,9 +1,6 @@
 ; With sub reassociation, constant folding can eliminate the two 12 constants.
 ;
-; RUN: if as < %s | opt -reassociate -constprop -dce | dis | grep 12
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -constprop -dce | dis | not grep 12
 
 int "test"(int %A, int %B, int %C, int %D) {
        %M = add int %A, 12
index ac5932053fd3bfd5cdac0e0dfbe22fe4657af6f9..cad7a5aafda66f7213fcc765032c457746cda5a7 100644 (file)
@@ -1,11 +1,8 @@
 ; With reassociation, constant folding can eliminate the 12 and -12 constants.
 ;
-; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep add
 
-int "test"(int %arg) {
+int %test(int %arg) {
        %tmp1 = sub int -12, %arg
        %tmp2 = add int %tmp1, 12
        ret int %tmp2
index 192b8d3d086c3a6b508a8be9dbb8db040723d610..31c3be0a8784532a076d07cf6a30a28ebe0066d1 100644 (file)
@@ -1,9 +1,6 @@
 ; With reassociation, constant folding can eliminate the +/- 30 constants.
 ;
-; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 30
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 30
 
 int "test"(int %reg109, int %reg1111) {
         %reg115 = add int %reg109, -30           ; <int> [#uses=1]
index a05e64a04d93b6221a799cbe7d375b0169adbfc9..06dea0bbbb758989db9c8554038fb70ff3adfc3d 100644 (file)
 ; In this case, we want to reassociate the specified expr so that i+j can be
 ; hoisted out of the inner most loop.
 ;
-; RUN: if as < %s | opt -reassociate | dis | grep 115 | grep 117
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate | dis | grep 115 | not grep 117
 
 %.LC0 = internal global [4 x sbyte] c"%d\0A\00"                ; <[4 x sbyte]*> [#uses=1]
 
index 7182e1f72acea65299ff3724378c35c05ae7b565..6960b1df99136030c499d7d3305dc179ea3a4fe2 100644 (file)
@@ -1,9 +1,6 @@
 ; Reassociation should apply to Add, Mul, And, Or, & Xor
 ;
-; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 12
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 12
 
 int "test_mul"(int %arg) {
         %tmp1 = mul int 12, %arg
index e3a7adf5aed7f8caf35d010f275cf6b2f7f7f4bf..38a887b56625fc7db02e3465923dd651fbb44a18 100644 (file)
@@ -1,9 +1,6 @@
 ; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
 ;
-; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 12
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 12
 
 int "test"(int %A, int %B) {
        %X = add int -12, %A
index 341847bc13ae6d5a674c0b39d1faf3adc47b8938..be8bbfda67fe820c3d741e99c9d6f0a4675f99ea 100644 (file)
@@ -5,13 +5,9 @@
 ; real benchmark (mst from Olden benchmark, MakeGraph function).  When SCCP is
 ; fixed, this should be eliminated by a single SCCP application.
 ;
-; RUN: if as < %s | opt -sccp | dis | grep loop
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -sccp | dis | not grep loop
 
-int *"test"()
-begin
+int* %test() {
 bb1:
        %A = malloc int
        br label %bb2
@@ -24,5 +20,4 @@ bb2:
 
 bb3:
        ret int * %A
-end
-
+}
index 8029456af7076007a4fcae70dafe0ea67cd08ef1..101ced7a651688fc88313dc88aab7e7b724897bb 100644 (file)
@@ -1,12 +1,7 @@
-; RUN: if as < %s | opt -sccp | dis | grep sub
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -sccp | dis | not grep sub
 
-void "test3"(int, int)
-begin
+void %test3(int, int) {
        add int 0, 0
         sub int 0, 4
         ret void
-end
-
+}
index c3c5d70a721bfaace234715230c810877ca0a8d5..a957a905db842dd1eb733e29f0a2914b67db35f2 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -sccp | dis | grep '%X'
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -sccp | dis | not grep '%X'
 
 %G = uninitialized global [40x int]
 
index e91c643cc01a30dcc1d896900ec83ac8997eca63..85ea1a7f60094bdac44f44ca22d21787cc5500fc 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -sccp -simplifycfg | dis | grep then:
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -sccp -simplifycfg | dis | not grep then:
 
 void %cprop_test11(int* %data.1) {
 entry:         ; No predecessors!
index 239f375e05295461d4a1035bef39ec7ba7fdd4b4..2ed9d5e47927844a29628faed16e225d427ea4b7 100644 (file)
@@ -1,13 +1,9 @@
 ; This is a basic sanity check for constant propogation.  The add instruction 
 ; should be eliminated.
 
-; RUN: if as < %s | opt -sccp | dis | grep add
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -sccp | dis | not grep add
 
-int "test"(bool %B)
-begin
+int %test(bool %B) {
        br bool %B, label %BB1, label %BB2
 BB1:
        %Val = add int 0, 0
@@ -17,4 +13,4 @@ BB2:
 BB3:
        %Ret = phi int [%Val, %BB1], [1, %BB2]
        ret int %Ret
-end
+}
index 20361f7d71d0ad0a904c635318561e68c3cf3e8a..37f4bc264ab684fb6ca6c5f4f445400719027171 100644 (file)
@@ -1,13 +1,9 @@
 ; This is the test case taken from appel's book that illustrates a hard case
 ; that SCCP gets right. BB3 should be completely eliminated.
 ;
-; RUN: if as < %s | opt -sccp -constprop -dce -cfgsimplify | dis | grep BB3
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -sccp -constprop -dce -cfgsimplify | dis | not grep BB3
 
-int "test function"(int %i0, int %j0)
-begin
+int %test function(int %i0, int %j0) {
 BB1:
        br label %BB2
 BB2:
@@ -35,5 +31,4 @@ BB7:
        %j4 = phi int [1, %BB5], [%k2, %BB6]
        %k4 = phi int [%k3, %BB5], [%k5, %BB6]
        br label %BB2
-end
-
+}
index a6474070e31de1c264fc59bed299f4599c744015..076659b39f2d23ce2676decfd3cc24bf3b358024 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -scalarrepl -mem2reg | dis | grep alloca
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -scalarrepl -mem2reg | dis | not grep alloca
 
 int %test() {
   %X = alloca [ 4 x int ]
index 0582a34c6922de93b12eedf712618c3eab274892..a576fd63624e139ae1c7db71072ca452193de228 100644 (file)
@@ -1,7 +1,4 @@
-; RUN: if as < %s | opt -scalarrepl -mem2reg | dis | grep alloca
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: as < %s | opt -scalarrepl -mem2reg | dis | not grep alloca
 
 int %test() {
   %X = alloca { int, float }