r173720 - FileCheck'ize tests

Dmitri Gribenko gribozavr at gmail.com
Mon Jan 28 13:43:46 PST 2013


Author: gribozavr
Date: Mon Jan 28 15:43:46 2013
New Revision: 173720

URL: http://llvm.org/viewvc/llvm-project?rev=173720&view=rev
Log:
FileCheck'ize tests

Modified:
    cfe/trunk/test/CodeGenCXX/member-functions.cpp
    cfe/trunk/test/Preprocessor/_Pragma-dependency.c
    cfe/trunk/test/Preprocessor/_Pragma-physloc.c

Modified: cfe/trunk/test/CodeGenCXX/member-functions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/member-functions.cpp?rev=173720&r1=173719&r2=173720&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/member-functions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/member-functions.cpp Mon Jan 28 15:43:46 2013
@@ -1,66 +1,85 @@
-// RUN: %clang_cc1 -emit-llvm %s -triple x86_64-apple-darwin9 -o %t
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin9 -o - %s | FileCheck %s
+
 struct C {
   void f();
   void g(int, ...);
 };
 
-// RUN: grep "define void @_ZN1C1fEv" %t | count 1
+// CHECK: define void @_ZN1C1fEv
 void C::f() {
 }
 
+// CHECK: define void @_Z5test1v
 void test1() {
   C c;
-  
-// RUN: grep "call void @_ZN1C1fEv" %t | count 1
+
+  // CHECK: call void @_ZN1C1fEv
   c.f();
-  
-// RUN: grep "call void (.struct.C\*, i32, ...)\* @_ZN1C1gEiz" %t | count 1
+
+  // CHECK: call void (%struct.C*, i32, ...)* @_ZN1C1gEiz
   c.g(1, 2, 3);
 }
 
 
 struct S {
-  // RUN: grep "define linkonce_odr void @_ZN1SC1Ev.*unnamed_addr" %t
   inline S() { }
-  // RUN: grep "define linkonce_odr void @_ZN1SC1Ev.*unnamed_addr" %t
   inline ~S() { }
-  
-  
-  // RUN: grep "define linkonce_odr void @_ZN1S9f_inline1Ev" %t
+
   void f_inline1() { }
-  // RUN: grep "define linkonce_odr void @_ZN1S9f_inline2Ev" %t
   inline void f_inline2() { }
-  
-  // RUN: grep "define linkonce_odr void @_ZN1S1gEv" %t
+
   static void g() { }
-  
   static void f();
 
-  // RUN: grep "define linkonce_odr void @_ZN1S1vEv.*unnamed_addr" %t
   virtual void v() {}
 };
 
-// RUN: grep "define void @_ZN1S1fEv" %t
+// CHECK: define void @_ZN1S1fEv
 void S::f() {
 }
 
 void test2() {
   S s;
-  
+
   s.f_inline1();
   s.f_inline2();
-  
+
   S::g();
-  
 }
 
+// S::S()
+// CHECK: define linkonce_odr void @_ZN1SC1Ev{{.*}} unnamed_addr
+
+// S::f_inline1()
+// CHECK: define linkonce_odr void @_ZN1S9f_inline1Ev
+
+// S::f_inline2()
+// CHECK: define linkonce_odr void @_ZN1S9f_inline2Ev
+
+// S::g()
+// CHECK: define linkonce_odr void @_ZN1S1gEv
+
+// S::~S()
+// CHECK: define linkonce_odr void @_ZN1SD1Ev{{.*}} unnamed_addr
+
 struct T {
   T operator+(const T&);
 };
 
+// CHECK: define void @_Z5test3v
 void test3() {
   T t1, t2;
-  
-  // RUN: grep "call void @_ZN1TplERKS_" %t
+
+  // CHECK: call void @_ZN1TplERKS_
   T result = t1 + t2;
 }
+
+// S::~S()
+// CHECK: define linkonce_odr void @_ZN1SD2Ev{{.*}} unnamed_addr
+
+// S::S()
+// CHECK: define linkonce_odr void @_ZN1SC2Ev{{.*}} unnamed_addr
+
+// S::v()
+// CHECK: define linkonce_odr void @_ZN1S1vEv{{.*}}unnamed_addr
+

Modified: cfe/trunk/test/Preprocessor/_Pragma-dependency.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/_Pragma-dependency.c?rev=173720&r1=173719&r2=173720&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/_Pragma-dependency.c (original)
+++ cfe/trunk/test/Preprocessor/_Pragma-dependency.c Mon Jan 28 15:43:46 2013
@@ -1,7 +1,6 @@
-// RUN: %clang_cc1 %s -E 2>&1 | grep 'DO_PRAGMA (STR'
-// RUN: %clang_cc1 %s -E 2>&1 | grep '7:3'
+// RUN: %clang_cc1 -E -verify %s
 
 #define DO_PRAGMA _Pragma 
 #define STR "GCC dependency \"parse.y\"")
-  // Test that this line is printed by caret diagnostics.
+// expected-error at +1 {{'parse.y' file not found}}
   DO_PRAGMA (STR

Modified: cfe/trunk/test/Preprocessor/_Pragma-physloc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/_Pragma-physloc.c?rev=173720&r1=173719&r2=173720&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/_Pragma-physloc.c (original)
+++ cfe/trunk/test/Preprocessor/_Pragma-physloc.c Mon Jan 28 15:43:46 2013
@@ -1,5 +1,6 @@
-// RUN: %clang_cc1 %s -E | grep '#pragma x y z'
-// RUN: %clang_cc1 %s -E | grep '#pragma a b c'
+// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
+// CHECK: {{^}}#pragma x y z{{$}}
+// CHECK: {{^}}#pragma a b c{{$}}
 
 _Pragma("x y z")
 _Pragma("a b c")





More information about the cfe-commits mailing list