From 8a0f0e2656abf76b771037c6543caf9a31744120 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Fri, 21 Feb 2020 15:21:19 -0800 Subject: [PATCH] [lldb/test] Tweak libcxx string test on Apple+ARM devices On Apple platforms, is __arm__ isn't defined and we're not on Intel, we use an alternate std::string layout. I.e., the libcxx string test fails on phones because the hand-crafted "garbage" string structs are actually valid strings. See: ``` // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility. #if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \ (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)) || \ defined(_LIBCPP_ALTERNATE_STRING_LAYOUT) #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT #endif ``` Disable inspection of the garbage structs on Apple+ARM devices. --- .../data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py index 37530671..c6f95d7 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py @@ -116,7 +116,9 @@ class LibcxxStringDataFormatterTestCase(TestBase): '%s::allocator >) uchar = "aaaaa"'%(ns,ns,ns), ]) - if is_64_bit: + # The test assumes that std::string is in its cap-size-data layout. + is_alternate_layout = ('arm' in self.getArchitecture()) and self.platformIsDarwin() + if is_64_bit and not is_alternate_layout: self.expect("frame variable garbage1", substrs=['garbage1 = Summary Unavailable']) self.expect("frame variable garbage2", substrs=['garbage2 = Summary Unavailable']) self.expect("frame variable garbage3", substrs=['garbage3 = Summary Unavailable']) -- 2.7.4