[llvm] [FileCheck]: Fix diagnostic for trailing CHECK-NOT (PR #78412)

Thomas Preud'homme via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 02:26:46 PST 2024


================
@@ -0,0 +1,12 @@
+; RUN: rm %t && \
+; RUN: echo "LEADING: placeholder1" >>%t && echo "TRAILING-NOT: placeholder2" >>%t && \
+; RUN: %ProtectFileCheckOutput not FileCheck --strict-whitespace --check-prefixes LEADING,TRAILING --input-file %t %t 2>&1 | \ 
+; RUN: FileCheck %s
+; END
+
+CHECK:           error: TRAILING-NOT: excluded string found in input
+CHECK-NEXT:      TRAILING-NOT: placeholder2
+CHECK-NEXT: {{^}}              ^{{$}}
+CHECK-NEXT:      note: found here
+CHECK-NEXT:      TRAILING-NOT: placeholder2
+CHECK-NEXT: {{^}}              ^~~~~~~~~~~~{{$}}
----------------
RoboTux wrote:

That does not seem to show the problem as the test pass even without your patch applied.

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


More information about the llvm-commits mailing list