FileCheck'ize tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173720 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dmitri Gribenko 2013-01-28 21:43:46 +00:00
parent fc60fbdea5
commit 319d8fc222
3 changed files with 46 additions and 27 deletions

View File

@ -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

View File

@ -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@+1 {{'parse.y' file not found}}
DO_PRAGMA (STR

View File

@ -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")