r179214 - FileCheck-ify some clang grep tests that use double quotes

Reid Kleckner reid at kleckner.net
Wed Apr 10 14:10:40 PDT 2013


Author: rnk
Date: Wed Apr 10 16:10:39 2013
New Revision: 179214

URL: http://llvm.org/viewvc/llvm-project?rev=179214&view=rev
Log:
FileCheck-ify some clang grep tests that use double quotes

The escaping interaction between Python and grep doesn't work on my
system.  This change fixes the tests for me.

Modified:
    cfe/trunk/test/CodeGen/2010-02-10-PointerName.c
    cfe/trunk/test/CodeGenObjC/encode-test-3.m
    cfe/trunk/test/CodeGenObjC/objc-align.m
    cfe/trunk/test/CodeGenObjC/synthesize_ivar-cont-class.m
    cfe/trunk/test/Driver/clang_cpp.c
    cfe/trunk/test/Frontend/rewrite-macros.c
    cfe/trunk/test/Preprocessor/cxx_oper_spelling.cpp

Modified: cfe/trunk/test/CodeGen/2010-02-10-PointerName.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-02-10-PointerName.c?rev=179214&r1=179213&r2=179214&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2010-02-10-PointerName.c (original)
+++ cfe/trunk/test/CodeGen/2010-02-10-PointerName.c Wed Apr 10 16:10:39 2013
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 %s -emit-llvm -g -o - | grep DW_TAG_pointer_type | grep -v {"char"}
+// RUN: %clang_cc1 %s -emit-llvm -g -o - | FileCheck %s
+// CHECK: DW_TAG_pointer_type
+// CHECK-NOT: {"char"}
 
 char i = 1;
 void foo() {

Modified: cfe/trunk/test/CodeGenObjC/encode-test-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/encode-test-3.m?rev=179214&r1=179213&r2=179214&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/encode-test-3.m (original)
+++ cfe/trunk/test/CodeGenObjC/encode-test-3.m Wed Apr 10 16:10:39 2013
@@ -1,12 +1,14 @@
-// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o %t %s
-// RUN: grep -e "\^i" %t | count 1
-// RUN: grep -e "\[0i\]" %t | count 1
+// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o - %s | FileCheck %s
 
 int main() {
   int n;
   
   const char * inc = @encode(int[]);
+// CHECK: ^i
+// CHECK-NOT: ^i
   const char * vla = @encode(int[n]);
+// CHECK: [0i]
+// CHECK-NOT: [0i]
 }
 
 // PR3648

Modified: cfe/trunk/test/CodeGenObjC/objc-align.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/objc-align.m?rev=179214&r1=179213&r2=179214&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/objc-align.m (original)
+++ cfe/trunk/test/CodeGenObjC/objc-align.m Wed Apr 10 16:10:39 2013
@@ -1,14 +1,14 @@
 // 32-bit
 
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
-// RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*, section "__OBJC,__category,regular,no_dead_strip", align 4' %t
-// RUN: grep '@"\\01L_OBJC_CLASS_A" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t
-// RUN: grep '@"\\01L_OBJC_CLASS_C" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t
-// RUN: grep '@"\\01L_OBJC_CLASS_PROTOCOLS_C" = internal global .*, section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t
-// RUN: grep '@"\\01L_OBJC_METACLASS_A" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t
-// RUN: grep '@"\\01L_OBJC_METACLASS_C" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t
-// RUN: grep '@"\\01L_OBJC_MODULES" = internal global .*, section "__OBJC,__module_info,regular,no_dead_strip", align 4' %t
-// RUN: grep '@"\\01L_OBJC_PROTOCOL_P" = internal global .*, section "__OBJC,__protocol,regular,no_dead_strip", align 4' %t
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
+// CHECK: @"\01L_OBJC_METACLASS_A" = internal global {{.*}}, section "__OBJC,__meta_class,regular,no_dead_strip", align 4
+// CHECK: @"\01L_OBJC_CLASS_A" = internal global {{.*}}, section "__OBJC,__class,regular,no_dead_strip", align 4
+// CHECK: @"\01L_OBJC_CATEGORY_A_Cat" = internal global {{.*}}, section "__OBJC,__category,regular,no_dead_strip", align 4
+// CHECK: @"\01L_OBJC_PROTOCOL_P" = internal global {{.*}}, section "__OBJC,__protocol,regular,no_dead_strip", align 4
+// CHECK: @"\01L_OBJC_CLASS_PROTOCOLS_C" = internal global {{.*}}, section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4
+// CHECK: @"\01L_OBJC_METACLASS_C" = internal global {{.*}}, section "__OBJC,__meta_class,regular,no_dead_strip", align 4
+// CHECK: @"\01L_OBJC_CLASS_C" = internal global {{.*}}, section "__OBJC,__class,regular,no_dead_strip", align 4
+// CHECK: @"\01L_OBJC_MODULES" = internal global {{.*}}, section "__OBJC,__module_info,regular,no_dead_strip", align 4
 
 // 64-bit
 

Modified: cfe/trunk/test/CodeGenObjC/synthesize_ivar-cont-class.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/synthesize_ivar-cont-class.m?rev=179214&r1=179213&r2=179214&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/synthesize_ivar-cont-class.m (original)
+++ cfe/trunk/test/CodeGenObjC/synthesize_ivar-cont-class.m Wed Apr 10 16:10:39 2013
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: grep '@"OBJC_IVAR_$_XCOrganizerDeviceNodeInfo.viewController"' %t
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
 
 // PR13820
 // REQUIRES: LP64
@@ -17,5 +16,6 @@
 
 @implementation XCOrganizerDeviceNodeInfo
 @synthesize viewController;
+// CHECK: @"OBJC_IVAR_$_XCOrganizerDeviceNodeInfo.viewController"
 @end
 

Modified: cfe/trunk/test/Driver/clang_cpp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang_cpp.c?rev=179214&r1=179213&r2=179214&view=diff
==============================================================================
--- cfe/trunk/test/Driver/clang_cpp.c (original)
+++ cfe/trunk/test/Driver/clang_cpp.c Wed Apr 10 16:10:39 2013
@@ -1,4 +1,5 @@
 // Verify that -include isn't included twice with -save-temps.
 // RUN: %clang -S -o - %s -include %t.h -save-temps -### 2> %t.log
-// RUN: grep '"-include' %t.log | count 1
-
+// RUN: FileCheck %s < %t.log
+// CHECK: "-include
+// CHECK-NOT: "-include

Modified: cfe/trunk/test/Frontend/rewrite-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/rewrite-macros.c?rev=179214&r1=179213&r2=179214&view=diff
==============================================================================
--- cfe/trunk/test/Frontend/rewrite-macros.c (original)
+++ cfe/trunk/test/Frontend/rewrite-macros.c Wed Apr 10 16:10:39 2013
@@ -1,17 +1,21 @@
-// RUN: %clang_cc1 -verify -rewrite-macros -o %t %s
+// RUN: %clang_cc1 %s -verify -rewrite-macros -o %t
+// RUN: FileCheck %s < %t
+
+// Any CHECK line comments are included in the output, so we use some extra
+// regex brackets to make sure we don't match the CHECK lines themselves.
 
 #define A(a,b) a ## b
 
-// RUN: grep '12 */\*A\*/ /\*(1,2)\*/' %t
+// CHECK: 12{{ *}}/*A*/ /*(1,2)*/
 A(1,2)
 
-// RUN: grep '/\*_Pragma("mark")\*/' %t
+// CHECK: /*_Pragma("{{mark}}")*/
 _Pragma("mark")
 
-// RUN: grep "//#warning eek" %t
+// CHECK: /*#warning {{eek}}*/
 /* expected-warning {{eek}} */ #warning eek
 
-// RUN: grep "//#pragma mark mark" %t
+// CHECK: //#pragma mark {{mark}}
 #pragma mark mark
 
 

Modified: cfe/trunk/test/Preprocessor/cxx_oper_spelling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/cxx_oper_spelling.cpp?rev=179214&r1=179213&r2=179214&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/cxx_oper_spelling.cpp (original)
+++ cfe/trunk/test/Preprocessor/cxx_oper_spelling.cpp Wed Apr 10 16:10:39 2013
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s | grep 'a: "and"'
+// RUN: %clang_cc1 -E %s | FileCheck %s
 
 #define X(A) #A
 
@@ -8,4 +8,5 @@
 //
 // This should be spelled as 'and', not '&&'
 a: X(and)
+// CHECK: a: "and"
 





More information about the cfe-commits mailing list