summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/data-formatter/data-formatter-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/functionalities/data-formatter/data-formatter-cpp')
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py18
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp2
2 files changed, 20 insertions, 0 deletions
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
index f5a206b39f4..97aae5c8e1c 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
@@ -182,7 +182,25 @@ class DataFormatterTestCase(TestBase):
self.expect("frame variable cool_pointer",
substrs = ['3,0,0'])
+ # test special symbols for formatting variables into summaries
+ self.runCmd("type summary add -f \"cool object @ ${var%L}\" i_am_cool")
+ self.runCmd("type summary delete \"i_am_cool [5]\"")
+ # this test might fail if the compiler tries to store
+ # these values into registers.. hopefully this is not
+ # going to be the case
+ self.expect("frame variable cool_array",
+ substrs = ['[0] = cool object @ 0x',
+ '[1] = cool object @ 0x',
+ '[2] = cool object @ 0x',
+ '[3] = cool object @ 0x',
+ '[4] = cool object @ 0x'])
+
+ self.runCmd("type summary add -f \"goofy\" i_am_cool")
+ self.runCmd("type summary add -f \"${var.second_cool%S}\" i_am_cooler")
+
+ self.expect("frame variable the_coolest_guy",
+ substrs = ['(i_am_cooler) the_coolest_guy = goofy'])
if __name__ == '__main__':
import atexit
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp b/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp
index 9224cb8a0a0..31f7c6bf934 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp
+++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp
@@ -110,6 +110,8 @@ int main (int argc, const char * argv[])
char strarr[32] = "Hello world!";
char* strptr = "Hello world!";
+
+ i_am_cooler the_coolest_guy(1,2,3.14,6.28,'E','G');
return 0; // Set break point at this line.
}
OpenPOWER on IntegriCloud