r185648 - Replace 'grep foo | count 0' with 'not grep foo'.

Rafael Espindola rafael.espindola at gmail.com
Thu Jul 4 08:22:16 PDT 2013


Author: rafael
Date: Thu Jul  4 10:22:16 2013
New Revision: 185648

URL: http://llvm.org/viewvc/llvm-project?rev=185648&view=rev
Log:
Replace 'grep foo | count 0' with 'not grep foo'.

This avoids depending on pipefail not being used.

Modified:
    cfe/trunk/test/Analysis/html-diags-multifile.c
    cfe/trunk/test/CodeGen/2008-07-31-asm-labels.c
    cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c
    cfe/trunk/test/CodeGen/bitfield-assign.c
    cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp
    cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp
    cfe/trunk/test/CodeGenCXX/implicit-instantiation-1.cpp
    cfe/trunk/test/CodeGenObjC/bitfield-ivar-offsets.m
    cfe/trunk/test/CodeGenObjC/blocks-1.m
    cfe/trunk/test/CodeGenObjC/objc2-no-write-barrier.m
    cfe/trunk/test/CodeGenObjC/objc2-write-barrier-5.m
    cfe/trunk/test/CodeGenObjC/protocols-lazy.m
    cfe/trunk/test/Driver/Xarch.c
    cfe/trunk/test/Driver/darwin-dsymutil.c
    cfe/trunk/test/Driver/darwin-verify-debug.c
    cfe/trunk/test/Driver/m_and_mm.c
    cfe/trunk/test/Frontend/darwin-version.c
    cfe/trunk/test/PCH/external-defs.c

Modified: cfe/trunk/test/Analysis/html-diags-multifile.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/html-diags-multifile.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/html-diags-multifile.c (original)
+++ cfe/trunk/test/Analysis/html-diags-multifile.c Thu Jul  4 10:22:16 2013
@@ -1,6 +1,6 @@
 // RUN: mkdir -p %t.dir
 // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir
-// RUN: ls %t.dir | grep report | count 0
+// RUN: ls %t.dir | not grep report
 // RUN: rm -fR %t.dir
 
 // This tests that we do not currently emit HTML diagnostics for reports that

Modified: cfe/trunk/test/CodeGen/2008-07-31-asm-labels.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-07-31-asm-labels.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2008-07-31-asm-labels.c (original)
+++ cfe/trunk/test/CodeGen/2008-07-31-asm-labels.c Thu Jul  4 10:22:16 2013
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: grep "@pipe()" %t | count 0
+// RUN: not grep "@pipe()" %t
 // RUN: grep '_thisIsNotAPipe' %t | count 3
-// RUN: grep 'g0' %t | count 0
+// RUN: not grep 'g0' %t
 // RUN: grep '_renamed' %t | count 2
 // RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
-// RUN: grep "@pipe()" %t | count 0
+// RUN: not grep "@pipe()" %t
 // RUN: grep '_thisIsNotAPipe' %t | count 3
 // <rdr://6116729>
 

Modified: cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c (original)
+++ cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c Thu Jul  4 10:22:16 2013
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1
 // RUN: %clang_cc1 -triple i386-unknown-unknown -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
-// RUN: %clang_cc1 -triple i386-unknown-unknown -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
+// RUN: %clang_cc1 -triple i386-unknown-unknown -ffreestanding -O2 -emit-llvm %s -o - | not grep 'declare i32 @puts'
 
 int printf(const char *, ...);
 

Modified: cfe/trunk/test/CodeGen/bitfield-assign.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/bitfield-assign.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/bitfield-assign.c (original)
+++ cfe/trunk/test/CodeGen/bitfield-assign.c Thu Jul  4 10:22:16 2013
@@ -10,8 +10,8 @@
 
 // Check that we got the right value.
 // RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm -o %t %s
-// RUN: grep 'load ' %t | count 0
-// RUN: grep "@g0" %t | count 0
+// RUN: not grep 'load ' %t
+// RUN: not grep "@g0" %t
 
 struct s0 {
   int f0 : 2;

Modified: cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp Thu Jul  4 10:22:16 2013
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: grep "_ZN1XaSERK1X" %t | count 0
+// RUN: not grep "_ZN1XaSERK1X" %t
 
 extern "C" int printf(...);
 

Modified: cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/copy-constructor-elim.cpp Thu Jul  4 10:22:16 2013
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: grep "_ZN1CC1ERK1C" %t | count 0
-// RUN: grep "_ZN1SC1ERK1S" %t | count 0
+// RUN: not grep "_ZN1CC1ERK1C" %t
+// RUN: not grep "_ZN1SC1ERK1S" %t
 
 extern "C" int printf(...);
 

Modified: cfe/trunk/test/CodeGenCXX/implicit-instantiation-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/implicit-instantiation-1.cpp?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/implicit-instantiation-1.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/implicit-instantiation-1.cpp Thu Jul  4 10:22:16 2013
@@ -20,7 +20,7 @@ void foo(X<int> &xi, X<float> *xfp, int
   // RUN: grep "linkonce_odr.*_ZN1XIfE1fEf" %t | count 1
   xfp->f(f);
   
-  // RUN: grep "linkonce_odr.*_ZN1XIfE1hEf" %t | count 0
+  // RUN: not grep "linkonce_odr.*_ZN1XIfE1hEf" %t
   
 }
 

Modified: cfe/trunk/test/CodeGenObjC/bitfield-ivar-offsets.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/bitfield-ivar-offsets.m?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/bitfield-ivar-offsets.m (original)
+++ cfe/trunk/test/CodeGenObjC/bitfield-ivar-offsets.m Thu Jul  4 10:22:16 2013
@@ -6,7 +6,7 @@
 // RUN: grep -F '@"OBJC_IVAR_$_I0._b3" = global i64 4, section "__DATA, __objc_ivar", align 8' %t
 // RUN: grep -F '@"OBJC_IVAR_$_I0._y" = global i64 6, section "__DATA, __objc_ivar", align 8' %t
 // RUN: grep -F '@"OBJC_IVAR_$_I0._b4" = global i64 7, section "__DATA, __objc_ivar", align 8' %t
-// RUN: grep -F '@"OBJC_IVAR_$_I0." = global' %t | count 0
+// RUN: not grep -F '@"OBJC_IVAR_$_I0." = global' %t
 
 @interface I0 {
   unsigned _b0:4;

Modified: cfe/trunk/test/CodeGenObjC/blocks-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/blocks-1.m?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/blocks-1.m (original)
+++ cfe/trunk/test/CodeGenObjC/blocks-1.m Thu Jul  4 10:22:16 2013
@@ -4,7 +4,7 @@
 // RUN: grep "__destroy_helper_block_" %t | count 4
 // RUN: grep "__Block_byref_object_copy_" %t | count 2
 // RUN: grep "__Block_byref_object_dispose_" %t | count 2
-// RUN: grep "i32 135)" %t | count 0
+// RUN: not grep "i32 135)" %t
 // RUN: grep "_Block_object_assign" %t | count 4
 // RUN: grep "objc_read_weak" %t | count 2
 // RUN: grep "objc_assign_weak" %t | count 3
@@ -14,7 +14,7 @@
 // RUN: grep "__destroy_helper_block_" %t | count 4
 // RUN: grep "__Block_byref_object_copy_" %t | count 2
 // RUN: grep "__Block_byref_object_dispose_" %t | count 2
-// RUN: grep "i32 135)" %t | count 0
+// RUN: not grep "i32 135)" %t
 // RUN: grep "_Block_object_assign" %t | count 4
 // RUN: grep "objc_read_weak" %t | count 2
 // RUN: grep "objc_assign_weak" %t | count 3

Modified: cfe/trunk/test/CodeGenObjC/objc2-no-write-barrier.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/objc2-no-write-barrier.m?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/objc2-no-write-barrier.m (original)
+++ cfe/trunk/test/CodeGenObjC/objc2-no-write-barrier.m Thu Jul  4 10:22:16 2013
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep 'objc_assign' %t | count 0
+// RUN: not grep 'objc_assign' %t
 // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep 'objc_assign' %t | count 0
+// RUN: not grep 'objc_assign' %t
 
 typedef struct {
     int ival;

Modified: cfe/trunk/test/CodeGenObjC/objc2-write-barrier-5.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/objc2-write-barrier-5.m?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/objc2-write-barrier-5.m (original)
+++ cfe/trunk/test/CodeGenObjC/objc2-write-barrier-5.m Thu Jul  4 10:22:16 2013
@@ -1,8 +1,8 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep objc_assign_ivar %t | count 0
+// RUN: not grep objc_assign_ivar %t
 // RUN: grep objc_assign_strongCast %t | count 8
 // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep objc_assign_ivar %t | count 0
+// RUN: not grep objc_assign_ivar %t
 // RUN: grep objc_assign_strongCast %t | count 8
 
 @interface TestUnarchiver 

Modified: cfe/trunk/test/CodeGenObjC/protocols-lazy.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/protocols-lazy.m?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/protocols-lazy.m (original)
+++ cfe/trunk/test/CodeGenObjC/protocols-lazy.m Thu Jul  4 10:22:16 2013
@@ -1,11 +1,11 @@
 // RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin8 -fobjc-runtime=macosx-fragile-10.5 -o %t %s
 
 // No object generated
-// RUN: grep OBJC_PROTOCOL_P0 %t | count 0
+// RUN: not grep OBJC_PROTOCOL_P0 %t
 @protocol P0;
 
 // No object generated
-// RUN: grep OBJC_PROTOCOL_P1 %t | count 0
+// RUN: not grep OBJC_PROTOCOL_P1 %t
 @protocol P1 -im1; @end
 
 // Definition triggered by protocol reference.
@@ -16,7 +16,7 @@ void f0() { id x = @protocol(P2); }
 
 // Forward definition triggered by protocol reference.
 // RUN: grep OBJC_PROTOCOL_P3 %t | count 3
-// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P3 %t | count 0
+// RUN: not grep OBJC_PROTOCOL_INSTANCE_METHODS_P3 %t
 @protocol P3;
 void f1() { id x = @protocol(P3); }
 

Modified: cfe/trunk/test/Driver/Xarch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Xarch.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/Driver/Xarch.c (original)
+++ cfe/trunk/test/Driver/Xarch.c Thu Jul  4 10:22:16 2013
@@ -1,7 +1,7 @@
 // RUN: %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log
 // RUN: grep ' "-O2" ' %t.log | count 1
 // RUN: %clang -target i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log
-// RUN: grep ' "-O2" ' %t.log | count 0
+// RUN: not grep ' "-O2" ' %t.log
 // RUN: grep "argument unused during compilation: '-Xarch_i386 -O2'" %t.log
 // RUN: not %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log
 // RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -o'" %t.log | count 2

Modified: cfe/trunk/test/Driver/darwin-dsymutil.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-dsymutil.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-dsymutil.c (original)
+++ cfe/trunk/test/Driver/darwin-dsymutil.c Thu Jul  4 10:22:16 2013
@@ -35,7 +35,7 @@
 // RUN: touch %t.o
 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
 // RUN:   -o foo %t.o -g 2> %t
-// RUN: grep "Dsymutil" %t | count 0
+// RUN: not grep "Dsymutil" %t
 
 // Check that we put the .dSYM in the right place.
 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \

Modified: cfe/trunk/test/Driver/darwin-verify-debug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-verify-debug.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-verify-debug.c (original)
+++ cfe/trunk/test/Driver/darwin-verify-debug.c Thu Jul  4 10:22:16 2013
@@ -31,4 +31,4 @@
 // RUN: touch %t.o
 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
 // RUN:   -verify -o foo %t.o -g 2> %t
-// RUN: grep "Verify" %t | count 0
+// RUN: not grep "Verify" %t

Modified: cfe/trunk/test/Driver/m_and_mm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/m_and_mm.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/Driver/m_and_mm.c (original)
+++ cfe/trunk/test/Driver/m_and_mm.c Thu Jul  4 10:22:16 2013
@@ -1,3 +1,3 @@
 // RUN: %clang -### \
 // RUN:   -M -MM %s 2> %t
-// RUN: grep '"-sys-header-deps"' %t | count 0
+// RUN: not grep '"-sys-header-deps"' %t

Modified: cfe/trunk/test/Frontend/darwin-version.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/darwin-version.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/Frontend/darwin-version.c (original)
+++ cfe/trunk/test/Frontend/darwin-version.c Thu Jul  4 10:22:16 2013
@@ -1,23 +1,23 @@
 // RUN: %clang -target armv6-apple-darwin9 -dM -E -o %t %s
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
 // RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
 // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=3.0 -dM -E -o %t %s
 // RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '30000' | count 1
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
 // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.0 -dM -E -o %t %s
 // RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20000' | count 1
-// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
 // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.2 -dM -E -o %t %s
 // RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20200' | count 1
 // RUN: %clang -target i686-apple-darwin8 -dM -E -o %t %s
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
 // RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
 // RUN: %clang -target i686-apple-darwin9 -dM -E -o %t %s
 // RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
 // RUN: %clang -target i686-apple-darwin10 -dM -E -o %t %s
 // RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
 // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -dM -E -o %t %s
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
 // RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
 // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.5 -dM -E -o %t %s
 // RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1

Modified: cfe/trunk/test/PCH/external-defs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/external-defs.c?rev=185648&r1=185647&r2=185648&view=diff
==============================================================================
--- cfe/trunk/test/PCH/external-defs.c (original)
+++ cfe/trunk/test/PCH/external-defs.c Thu Jul  4 10:22:16 2013
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s
 
 // RUN: grep "@x = common global i32 0" %t | count 1
-// RUN: grep "@z" %t | count 0
+// RUN: not grep "@z" %t
 
 // RUN: grep "@x2 = global i32 19" %t | count 1
 int x2 = 19;





More information about the cfe-commits mailing list