Author: Michael Buch
Date: 2026-01-05T15:08:23Z
New Revision: e982b4f411490846095f62f4edf610652cb4ba65

URL: 
https://github.com/llvm/llvm-project/commit/e982b4f411490846095f62f4edf610652cb4ba65
DIFF: 
https://github.com/llvm/llvm-project/commit/e982b4f411490846095f62f4edf610652cb4ba65.diff

LOG: [lldb][test] Add tests for printing references to C-strings

Printing references to C-strings doesn't work properly at the moment. This 
patch provides coverage for those cases and should fail once the underlying 
issue gets fixed (see https://github.com/llvm/llvm-project/pull/174398).

Added: 
    

Modified: 
    
lldb/test/API/functionalities/data-formatter/stringprinter/TestStringPrinter.py
    lldb/test/API/functionalities/data-formatter/stringprinter/main.cpp

Removed: 
    


################################################################################
diff  --git 
a/lldb/test/API/functionalities/data-formatter/stringprinter/TestStringPrinter.py
 
b/lldb/test/API/functionalities/data-formatter/stringprinter/TestStringPrinter.py
index fa6cfb46ed413..3747bb4f1e2fd 100644
--- 
a/lldb/test/API/functionalities/data-formatter/stringprinter/TestStringPrinter.py
+++ 
b/lldb/test/API/functionalities/data-formatter/stringprinter/TestStringPrinter.py
@@ -50,3 +50,16 @@ def test(self):
         )
 
         # FIXME: make "b.data" and "c.data" work sanely
+
+        self.expect_var_path(
+            "ref",
+            summary="<no value available>",
+            children=[ValueCheck(name="&ref", summary='"Hello"')],
+        )
+
+        # FIXME: should LLDB use "&&refref" for the name here?
+        self.expect_var_path(
+            "refref",
+            summary="<no value available>",
+            children=[ValueCheck(name="&refref", summary='"Hi"')],
+        )

diff  --git 
a/lldb/test/API/functionalities/data-formatter/stringprinter/main.cpp 
b/lldb/test/API/functionalities/data-formatter/stringprinter/main.cpp
index 3bbc9b28b8c08..e4e28c94080f7 100644
--- a/lldb/test/API/functionalities/data-formatter/stringprinter/main.cpp
+++ b/lldb/test/API/functionalities/data-formatter/stringprinter/main.cpp
@@ -76,6 +76,10 @@ int main(int argc, char const *argv[]) {
       "this a few times, you know.."
       " for science, or something";
 
+  const char *basic = "Hello";
+  const char *&ref = basic;
+  const char *&&refref = "Hi";
+
   puts("Break here");
 
   return 0;


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to