[clang] 275ab24 - [Clang][test] Avoid FileCheck error when matching `-cc1`
Bryan Chan via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 20 20:37:05 PST 2023
Author: hezuoqiang
Date: 2023-01-20T23:36:09-05:00
New Revision: 275ab246ee811507a2b1d2e42b2d655a25c8df6c
URL: https://github.com/llvm/llvm-project/commit/275ab246ee811507a2b1d2e42b2d655a25c8df6c
DIFF: https://github.com/llvm/llvm-project/commit/275ab246ee811507a2b1d2e42b2d655a25c8df6c.diff
LOG: [Clang][test] Avoid FileCheck error when matching `-cc1`
FileCheck patterns consisting of only `-cc1` on a line by itself often
cause mismatches, e.g. with version strings formed from commit hashes
such as "clang-cc1514432c58". They should be changed to contain more
context and match more precisely.
Differential Revision: https://reviews.llvm.org/D141886
Added:
Modified:
clang/test/Driver/modules-ts.cpp
clang/test/Driver/modules.cpp
clang/test/OpenMP/driver.c
Removed:
################################################################################
diff --git a/clang/test/Driver/modules-ts.cpp b/clang/test/Driver/modules-ts.cpp
index eb2f535f5e445..30bb9d7a5bf35 100644
--- a/clang/test/Driver/modules-ts.cpp
+++ b/clang/test/Driver/modules-ts.cpp
@@ -23,8 +23,7 @@
// RUN: %clang -fmodules-ts -fmodule-file=%t.pcm -fintegrated-as -Dexport= %s -c -o %t.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-USE
//
// CHECK-USE: warning: the '-fmodules-ts' flag is deprecated and it will be removed in Clang 17; use '-std=c++20' or higher to use standard C++ modules instead [-Wdeprecated-module-ts]
-// CHECK-USE: -cc1
-// CHECK-USE-SAME: -emit-obj
+// CHECK-USE: -cc1 {{.*}} -emit-obj
// CHECK-USE-SAME: -fmodule-file={{.*}}.pcm
// CHECK-USE-SAME: -o {{.*}}.o{{"?}} {{.*}}-x c++
// CHECK-USE-SAME: modules-ts.cpp
diff --git a/clang/test/Driver/modules.cpp b/clang/test/Driver/modules.cpp
index d54ce393fe345..e63c946770d37 100644
--- a/clang/test/Driver/modules.cpp
+++ b/clang/test/Driver/modules.cpp
@@ -24,8 +24,7 @@
// RUN: %clang -std=c++2a -fmodule-file=%t/module.pcm -Dexport= %s -S -o %t/module.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-USE
// RUN: %clang -std=c++20 -fmodule-file=%t/module.pcm -Dexport= %s -S -o %t/module.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-USE
//
-// CHECK-USE: -cc1
-// CHECK-USE-SAME: {{-emit-obj|-S}}
+// CHECK-USE: -cc1 {{.*}} {{-emit-obj|-S}}
// CHECK-USE-SAME: -fmodule-file={{.*}}.pcm
// CHECK-USE-SAME: -o {{.*}}.{{o|s}}{{"?}} {{.*}}-x c++
// CHECK-USE-SAME: modules.cpp
diff --git a/clang/test/OpenMP/driver.c b/clang/test/OpenMP/driver.c
index 2533ec7e05b60..568160d93a222 100644
--- a/clang/test/OpenMP/driver.c
+++ b/clang/test/OpenMP/driver.c
@@ -3,12 +3,12 @@
//
// RUN: %clang %s -### -o %t.o 2>&1 -fopenmp=libomp | FileCheck --check-prefix=CHECK-DEFAULT %s
-// CHECK-DEFAULT: -cc1
+// CHECK-DEFAULT: "-cc1"
// CHECK-DEFAULT-NOT: -fnoopenmp-use-tls
//
// RUN: %clang %s -### -o %t.o 2>&1 -fopenmp=libomp -fnoopenmp-use-tls | FileCheck --check-prefix=CHECK-NO-TLS %s
-// CHECK-NO-TLS: -cc1
+// CHECK-NO-TLS: "-cc1"
// CHECK-NO-TLS-SAME: -fnoopenmp-use-tls
//
// RUN: %clang %s -c -E -dM -fopenmp=libomp | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s
More information about the cfe-commits
mailing list