From 8448e1a66582916a856c73e9763a1765a9c48288 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Sat, 9 Feb 2013 16:41:47 +0000 Subject: [PATCH] FileCheck'ize tests git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174815 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Preprocessor/macro_rescan.c | 14 ++++++++------ test/Preprocessor/macro_space.c | 3 ++- test/Preprocessor/print_line_count.c | 5 ++++- test/Preprocessor/skipping_unclean.c | 3 ++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/test/Preprocessor/macro_rescan.c b/test/Preprocessor/macro_rescan.c index 3a3854841c..83a1975b4e 100644 --- a/test/Preprocessor/macro_rescan.c +++ b/test/Preprocessor/macro_rescan.c @@ -1,9 +1,11 @@ -// RUN: %clang_cc1 -E %s | grep 'ei_1 = (17 +1);' -// RUN: %clang_cc1 -E %s | grep 'ei_2 = (M1)(17);' +// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s -#define M1(a) (a+1) -#define M2(b) b +#define M1(a) (a+1) +#define M2(b) b -int ei_1 = M2(M1)(17); /* becomes int ei_1 = (17+1); */ -int ei_2 = (M2(M1))(17); /* becomes int ei_2 = (M1)(17); */ +int ei_1 = M2(M1)(17); +// CHECK: {{^}}int ei_1 = (17 +1);{{$}} + +int ei_2 = (M2(M1))(17); +// CHECK: {{^}}int ei_2 = (M1)(17);{{$}} diff --git a/test/Preprocessor/macro_space.c b/test/Preprocessor/macro_space.c index 49a9a0fac2..8a47a3b08f 100644 --- a/test/Preprocessor/macro_space.c +++ b/test/Preprocessor/macro_space.c @@ -1,5 +1,6 @@ -// RUN: %clang_cc1 %s -E | grep '! ,' +// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s #define XX ! XX, +// CHECK: {{^}}! ,{{$}} diff --git a/test/Preprocessor/print_line_count.c b/test/Preprocessor/print_line_count.c index 6a02b0eede..6ada93b24c 100644 --- a/test/Preprocessor/print_line_count.c +++ b/test/Preprocessor/print_line_count.c @@ -1,4 +1,7 @@ -/* RUN: %clang -E -C -P %s | wc -l | grep 4 +/* RUN: %clang -E -C -P %s | FileCheck --strict-whitespace %s PR2741 comment */ y +// CHECK: {{^}} comment */{{$}} +// CHECK-NEXT: {{^}}y{{$}} + diff --git a/test/Preprocessor/skipping_unclean.c b/test/Preprocessor/skipping_unclean.c index 52d1785030..ce75b3990e 100644 --- a/test/Preprocessor/skipping_unclean.c +++ b/test/Preprocessor/skipping_unclean.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -E %s | grep bark +// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s #if 0 blah @@ -6,4 +6,5 @@ blah else bark #endif +// CHECK: {{^}}bark{{$}} -- 2.40.0