From 904a3e51839d725cfe8527fedfad85398e0b02aa Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Fri, 10 May 2019 20:11:36 +0000 Subject: [PATCH] Fixed tests where grep was not matching the linefeed When files are synchronized locally as CRLF on Windows, grep didn't match the newline. Switched to FileCheck instead. Differential Revision: https://reviews.llvm.org/D61496 llvm-svn: 360467 --- clang/test/Preprocessor/indent_macro.c | 3 ++- clang/test/Preprocessor/macro_fn_varargs_named.c | 9 ++++++--- clang/test/Preprocessor/macro_not_define.c | 3 ++- clang/test/Preprocessor/macro_rparen_scan.c | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/clang/test/Preprocessor/indent_macro.c b/clang/test/Preprocessor/indent_macro.c index e69500750f51a..f1430e9576422 100644 --- a/clang/test/Preprocessor/indent_macro.c +++ b/clang/test/Preprocessor/indent_macro.c @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -E %s | grep '^ zzap$' +// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace +// CHECK: zzap // zzap is on a new line, should be indented. #define BLAH zzap diff --git a/clang/test/Preprocessor/macro_fn_varargs_named.c b/clang/test/Preprocessor/macro_fn_varargs_named.c index b50d53d46d015..d27f5b3985baa 100644 --- a/clang/test/Preprocessor/macro_fn_varargs_named.c +++ b/clang/test/Preprocessor/macro_fn_varargs_named.c @@ -1,6 +1,9 @@ -// RUN: %clang_cc1 -E %s | grep '^a: x$' -// RUN: %clang_cc1 -E %s | grep '^b: x y, z,h$' -// RUN: %clang_cc1 -E %s | grep '^c: foo(x)$' +// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix CHECK-1 +// CHECK-1:a: x +// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix CHECK-2 +// CHECK-2:b: x y, z,h +// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace --check-prefix CHECK-3 +// CHECK-3:c: foo(x) #define A(b, c...) b c a: A(x) diff --git a/clang/test/Preprocessor/macro_not_define.c b/clang/test/Preprocessor/macro_not_define.c index 82648d47d447b..c0e9c85831118 100644 --- a/clang/test/Preprocessor/macro_not_define.c +++ b/clang/test/Preprocessor/macro_not_define.c @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -E %s | grep '^ # define X 3$' +// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace +// CHECK: # define X 3 #define H # #define D define diff --git a/clang/test/Preprocessor/macro_rparen_scan.c b/clang/test/Preprocessor/macro_rparen_scan.c index e4de5dbcef0c9..7dfa98e4a88cd 100644 --- a/clang/test/Preprocessor/macro_rparen_scan.c +++ b/clang/test/Preprocessor/macro_rparen_scan.c @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -E %s | grep '^3 ;$' +// RUN: %clang_cc1 -E %s | FileCheck %s --match-full-lines --strict-whitespace +// CHECK:3 ; /* Right paren scanning, hard case. Should expand to 3. */ #define i(x) 3