[PATCH] D141886: [Clang][test] Avoid FileCheck error when matching `-cc1`

hezuoqiang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 16 22:52:17 PST 2023


hzq updated this revision to Diff 489705.
hzq retitled this revision from "[Clang][Test] Avoid matching version numbers" to "[Clang][test] Avoid FileCheck error when matching `-cc1`".
hzq added a comment.

Add `-###` to the command line and update the check content.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141886/new/

https://reviews.llvm.org/D141886

Files:
  clang/test/Driver/modules-ts.cpp
  clang/test/Driver/modules.cpp
  clang/test/OpenMP/driver.c


Index: clang/test/OpenMP/driver.c
===================================================================
--- clang/test/OpenMP/driver.c
+++ 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
Index: clang/test/Driver/modules.cpp
===================================================================
--- clang/test/Driver/modules.cpp
+++ clang/test/Driver/modules.cpp
@@ -21,13 +21,13 @@
 
 // Check use of a .pcm file in another compilation.
 //
-// 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
+// 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: "-cc1"
 // CHECK-USE-SAME: {{-emit-obj|-S}}
 // CHECK-USE-SAME: -fmodule-file={{.*}}.pcm
-// CHECK-USE-SAME: -o {{.*}}.{{o|s}}{{"?}} {{.*}}-x c++
+// CHECK-USE-SAME: "-o" {{.*}}.{{o|s}}" {{.*}}-x" "c++"
 // CHECK-USE-SAME: modules.cpp
 
 // Check combining precompile and compile steps works.
Index: clang/test/Driver/modules-ts.cpp
===================================================================
--- clang/test/Driver/modules-ts.cpp
+++ clang/test/Driver/modules-ts.cpp
@@ -18,12 +18,12 @@
 
 // Check use of a .pcm file in another compilation.
 //
-// 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
+// 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: -cc1
+// CHECK-USE: "-cc1"
 // CHECK-USE-SAME: -emit-obj
 // CHECK-USE-SAME: -fmodule-file={{.*}}.pcm
-// CHECK-USE-SAME: -o {{.*}}.o{{"?}} {{.*}}-x c++
+// CHECK-USE-SAME: {{.*}}.o" {{.*}}-x" "c++"
 // CHECK-USE-SAME: modules-ts.cpp
 
 // Check combining precompile and compile steps works.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141886.489705.patch
Type: text/x-patch
Size: 2672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230117/46134211/attachment.bin>


More information about the cfe-commits mailing list