Skip to content

Conversation

@charles-zablit
Copy link
Contributor

This patch fixes issues introduced by #171491 when running tests in CI.

The shell tests expect certain characters when matching diagnostics. With #171491, those characters can either be Unicode specific characters or their ASCII equivalent. The tests were always expecting the ASCII version. This patch fixes this by using a regex to match one or the other.

@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2025

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

Changes

This patch fixes issues introduced by #171491 when running tests in CI.

The shell tests expect certain characters when matching diagnostics. With #171491, those characters can either be Unicode specific characters or their ASCII equivalent. The tests were always expecting the ASCII version. This patch fixes this by using a regex to match one or the other.


Full diff: https://github.com/llvm/llvm-project/pull/171685.diff

3 Files Affected:

  • (modified) lldb/test/Shell/Commands/command-dwim-print.test (+3-3)
  • (modified) lldb/test/Shell/Commands/command-expr-diagnostics.test (+5-5)
  • (modified) lldb/test/Shell/Commands/command-options.test (+3-3)
diff --git a/lldb/test/Shell/Commands/command-dwim-print.test b/lldb/test/Shell/Commands/command-dwim-print.test
index 9153edbd21791..88e7314976ad8 100644
--- a/lldb/test/Shell/Commands/command-dwim-print.test
+++ b/lldb/test/Shell/Commands/command-dwim-print.test
@@ -1,16 +1,16 @@
 # RUN: echo quit | %lldb -o "dwim-print a" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK1
 #            (lldb) dwim-print a 
-# CHECK1:{{^                  \^}}
+# CHECK1:{{^                  (\^|˄)}}
 # CHECK1: {{^                  error: use of undeclared identifier 'a'}}
 # RUN: echo quit | %lldb -o "p a" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK2
 #            (lldb) p a 
-# CHECK2:{{^         \^}}
+# CHECK2:{{^         (\^|˄)}}
 # RUN: echo quit | %lldb -o "dwim-print -- a" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK3
 #            (lldb) dwim-print -- a 
-# CHECK3:{{^                     \^}}
+# CHECK3:{{^                     (\^|˄)}}
 # RUN: echo quit | %lldb -o "settings set show-inline-diagnostics false" \
 # RUN:   -o "dwim-print a" 2>&1 | FileCheck %s --check-prefix=CHECK4
 # CHECK4: error: <user expression 0>:1:1: use of undeclared identifier
diff --git a/lldb/test/Shell/Commands/command-expr-diagnostics.test b/lldb/test/Shell/Commands/command-expr-diagnostics.test
index 3c827fb4516ec..cde0e6c6768f7 100644
--- a/lldb/test/Shell/Commands/command-expr-diagnostics.test
+++ b/lldb/test/Shell/Commands/command-expr-diagnostics.test
@@ -2,19 +2,19 @@
 # RUN: echo quit | %lldb -o "expression a+b" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK1
 #            (lldb) expression a+b
-# CHECK1:{{^                  \^ \^}}
-# CHECK1: {{^                  | error: use of undeclared identifier 'b'}}
+# CHECK1:{{^                  (\^|˄) (\^|˄)}}
+# CHECK1: {{^                  (\||│) error: use of undeclared identifier 'b'}}
 # CHECK1: {{^                  error: use of undeclared identifier 'a'}}
 
 # RUN: echo quit | %lldb -o "expr a" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK2
 #            (lldb) expr a 
-# CHECK2:{{^            \^}}
+# CHECK2:{{^            (\^|˄)}}
 
 # RUN: echo quit | %lldb -o "expr -i 0 -o 0 -- a" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK3
 #            (lldb) expr -i 0 -o 0 -- a
-# CHECK3:{{^                         \^}}
+# CHECK3:{{^                         (\^|˄)}}
 # CHECK3: {{^                         error: use of undeclared identifier 'a'}}
 
 # RUN: echo "int main(){return 0;}">%t.c
@@ -23,7 +23,7 @@
 # RUN: "expr --top-level -- template<typename T> T FOO(T x) { return x/2;}" -o \
 # RUN: "expression -- FOO(\"\")" 2>&1 | FileCheck %s --check-prefix=CHECK4
 #            (lldb) expression -- FOO("")
-# CHECK4:{{^                     \^}}
+# CHECK4:{{^                     (\^|˄)}}
 # CHECK4: {{^                     note: in instantiation of function template}}
 # CHECK4: error: <user expression
 
diff --git a/lldb/test/Shell/Commands/command-options.test b/lldb/test/Shell/Commands/command-options.test
index 73aa374bde297..cec495e30b28c 100644
--- a/lldb/test/Shell/Commands/command-options.test
+++ b/lldb/test/Shell/Commands/command-options.test
@@ -1,16 +1,16 @@
 # RUN: echo quit | %lldb -O "log enable -x" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK1
 #            (lldb) log enable -x
-# CHECK1:{{^                  \^~}}
+# CHECK1:{{^                  (\^|˄)(~|˜)}}
 # CHECK1: {{^                  error: unknown or ambiguous option}}
 
 # RUN: echo quit | %lldb -O "    log enable -xxxxxxx" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK2
 #            (lldb)     log enable -xxxxxxx
-# CHECK2:{{^                      \^~~~~~~~}}
+# CHECK2:{{^                      [\^|]~~~~~~~}}
 # CHECK2: {{^                      error: unknown or ambiguous option}}
 # RUN: echo quit | %lldb -O "log enable dwarf all -f dwarf.log -x" \
 # RUN:   | FileCheck %s --strict-whitespace --check-prefix=CHECK3
 #            (lldb) log enable dwarf all -f dwarf.log -x
-# CHECK3:{{^                                         \^~}}
+# CHECK3:{{^                                         [\^|]~}}
 # CHECK3: {{^                                         error: unknown or ambiguous option}}

@charles-zablit charles-zablit merged commit 871dabc into llvm:main Dec 10, 2025
12 checks passed
@slydiman
Copy link
Contributor

Nothing changed
https://lab.llvm.org/buildbot/#/builders/197/builds/11757
https://lab.llvm.org/buildbot/#/builders/211/builds/4494

Windows will not print unicode chars to stdout without a special system settings.

@charles-zablit
Copy link
Contributor Author

charles-zablit commented Dec 11, 2025

Nothing changed lab.llvm.org/buildbot#/builders/197/builds/11757 lab.llvm.org/buildbot#/builders/211/builds/4494

I reverted the changes.

Windows will not print unicode chars to stdout without a special system settings.

I don't think that's what's happening in the CI, because the logs do say:

# | <stdin>:19:19: note: possible intended match here
# |                   ╰─ error: use of undeclared identifier 'a'

I am not hitting this issue when testing on macOS, I will try to rerun the full test suite on Windows.

@slydiman
Copy link
Contributor

slydiman commented Dec 11, 2025

I was able to pass the test command-options.test on Windows with the following regex

# CHECK1: {{^                  (\^|˄)(~|˜)}}
# CHECK1: {{^                  .*error: unknown or ambiguous option}}

I added .* before error: to skip ╰─ in the line

                  ╰─ error: unknown or ambiguous option

@charles-zablit
Copy link
Contributor Author

Thanks for looking into this!

I was able to get all the tests to pass on Windows: #171832

I'm not sure about lldb/test/Shell/Commands/command-expr-diagnostics.test however, as it's XFAILed on Windows. I passes on macOS. The previous failure was on which is lldb-remote-linux-win. I want to reproduce it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants