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

Bryan Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 17 10:47:05 PST 2023


bryanpkc requested changes to this revision.
bryanpkc added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/test/Driver/modules-ts.cpp:23
 //
-// CHECK-USE: -cc1
+// CHECK-USE: -cc1{{[^[:xdigit:]]}}
 // CHECK-USE-SAME: -emit-obj
----------------
bryanpkc wrote:
> An easier-to-understand fix is to simply combine this line and the next:
> ```
> // CHECK-USE: -cc1 {{.*}} -emit-obj
> ```
Adding `-###` to this test totally changes the meaning of the test, and is not what I asked for. See lines 5 and 14 for examples of the correct approach.


================
Comment at: clang/test/Driver/modules.cpp:24-25
 //
-// 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
 //
----------------
Do not add `-###`, which totally changes the meaning of the test. See line 17 for an example of what you need to do here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141886



More information about the cfe-commits mailing list