[llvm-branch-commits] [llvm] [FileCheck] Refactor -dump-input test (PR #198137)

Joel E. Denny via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 22 10:02:51 PDT 2026


================
@@ -713,26 +746,33 @@
 ; RUN: echo 'CHECK-NOT: [[DEF_MATCH1]] [[DEF_MATCH2]]'            >> %t.chk
 ; RUN: echo 'CHECK: END'                                          >> %t.chk
 
-; RUN: %ProtectFileCheckOutput \
-; RUN: not FileCheck -dump-input=always -vv -input-file=%t.in %t.chk 2>&1 \
-; RUN:               -DDEF_MATCH1=def-match1 -DDEF_MATCH2=def-match2 \
-; RUN:               -DDEF_NOMATCH=foobar \
-; RUN: | FileCheck -match-full-lines %s -check-prefix=SUBST-NEG
-
-;      SUBST-NEG:<<<<<<
-; SUBST-NEG-NEXT:         1: def-match1 def-nomatch
-; SUBST-NEG-NEXT:not:1'0     X~~~~~~~~~~~~~~~~~~~~~~ error: match failed for invalid pattern
-; SUBST-NEG-NEXT:not:1'1                             undefined variable: UNDEF
-; SUBST-NEG-NEXT:not:1'2                             with "DEF_MATCH1" equal to "def-match1"
-; SUBST-NEG-NEXT:not:1'3                             with "DEF_NOMATCH" equal to "foobar"
-; SUBST-NEG-NEXT:         2: def-match1 def-match2
-; SUBST-NEG-NEXT:not:1'0     ~~~~~~~~~~~~~~~~~~~~~~
-; SUBST-NEG-NEXT:not:2'0     !~~~~~~~~~~~~~~~~~~~~  error: no match expected
-; SUBST-NEG-NEXT:not:2'1                            with "DEF_MATCH1" equal to "def-match1"
-; SUBST-NEG-NEXT:not:2'2                            with "DEF_MATCH2" equal to "def-match2"
-; SUBST-NEG-NEXT:         3: END
-; SUBST-NEG-NEXT:check:3     ^~~
-; SUBST-NEG-NEXT:>>>>>>
+; REDEFINE: %{pre} = SUBST-NEG
+; REDEFINE: %{opts} =  \
+; REDEFINE:     -DDEF_MATCH1=def-match1 -DDEF_MATCH2=def-match2 \
+; REDEFINE:     -DDEF_NOMATCH=foobar
+; RUN: not %{run-vv}
+; RUN: not %{run-v}
+; RUN: not %{run}
+; REDEFINE: %{opts} =
+
+; Verbose diagnostics are suppressed but not errors.
+; SUBST-NEG:{{.*}}error:{{.*}}
+; SUBST-NEG:{{.*}}error:{{.*}}
----------------
jdenny-ornl wrote:

No, multiple errors, as expanded in the input dump below.  Would using `-COUNT-2` make this clearer?

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


More information about the llvm-branch-commits mailing list