[llvm] [FileCheck] Fix parsing empty global and pseudo variable names (PR #82595)

Thomas Preud'homme via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 03:48:20 PST 2024


================
@@ -0,0 +1,32 @@
+a
+
+; RUN: not FileCheck -input-file %s %s 2>&1 | \
+; RUN:   FileCheck -check-prefix CHECK-ERROR -DDIR=%S \
+; RUN:   --match-full-lines --strict-whitespace %s
+
+; CHECK:        a[[]]
+; CHECK-ERROR:[[DIR]]/empty-variable-name.txt:7:13: error: empty variable name
+; CHECK-ERROR-NEXT:; CHECK: a{{\[\[\]\]}}
----------------
RoboTux wrote:

What we do typically is add some space before the CHECK directive so that the caret (^) aligns with the caracter it points to in the real output. So for instance the output here is:
```
; CHECK: a[[]]
            ^
```

with the caret just under the `]` so you would write:

```
; CHECK-ERROR-NEXT:; CHECK: a{{\[\[\]\]}}
;      CHECK-ERROR-NEXT:            ^
```

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


More information about the llvm-commits mailing list