[llvm] [llvm-lit] Resolve env subcommand required error (PR #98414)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 07:30:20 PDT 2024


================
@@ -34,9 +34,9 @@
 # CHECK: --
 
 # CHECK: PASS: shtest-env :: env-args-none.txt ({{[^)]*}})
-# CHECK: env
+# CHECK: env | {{.*}}
 # CHECK: # executed command: env
-# CHECK-NOT: {{^[^#]}}
+# CHECK-NOT: {{^[^#]}} | {{.*}}
----------------
ilovepi wrote:

Well, I’m also a bit concerned about the CHECK-NOT case. It’s often hard to write a negative match that works the way you intended.  The pattern used elsewhere in this file does not have a trailing |{{.*}}.  Instead it would fail if it found any line with a leading “#”.  The new pattern does not preserve that property, and is thus would miss some cases that would otherwise be caught. 

The CHECK-NOT checks are not affected by —match-whole-lines, so there isn’t a need for a trailing {{.*}} in any case. https://llvm.org/docs/CommandGuide/FileCheck.html#cmdoption-FileCheck-match-full-lines

My suggestion would be to use that common pattern for the negative match. 

https://github.com/llvm/llvm-project/pull/98414


More information about the llvm-commits mailing list