[Lldb-commits] [lldb] 0feb00f - [lldb][test] TestCPPEnumPromotion: make sure enums are preserved in dSYM
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 13 10:13:35 PST 2025
Author: Michael Buch
Date: 2025-02-13T18:13:09Z
New Revision: 0feb00f17cbaac7428dcb7aed13d903b65974978
URL: https://github.com/llvm/llvm-project/commit/0feb00f17cbaac7428dcb7aed13d903b65974978
DIFF: https://github.com/llvm/llvm-project/commit/0feb00f17cbaac7428dcb7aed13d903b65974978.diff
LOG: [lldb][test] TestCPPEnumPromotion: make sure enums are preserved in dSYM
On macOS CI this was failing with:
```
FAIL: test_dsym (TestCPPEnumPromotion.TestCPPEnumPromotion)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1784, in test_method
return attrvalue(self)
File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/lang/cpp/enum_promotion/TestCPPEnumPromotion.py", line 28, in test
self.expect_expr("+EnumUChar::UChar", result_type=UChar_promoted.type.name)
File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2540, in expect_expr
value_check.check_value(self, eval_result, str(eval_result))
File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 299, in check_value
test_base.assertSuccess(val.GetError())
File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2575, in assertSuccess
self.fail(self._formatMessage(msg, "'{}' is not success".format(error)))
AssertionError: 'error: <user expression 0>:1:2: use of undeclared identifier 'EnumUChar'
1 | +EnumUChar::UChar
| ^
' is not success
```
But only for the `dSYM` variant of the test.
Looking at the dSYM, none of the enums are actually preserved in the debug-info. We have to actually use the enum types in source to get dsymutil to preserve them. This patch does just that.
Added:
Modified:
lldb/test/API/lang/cpp/enum_promotion/main.cpp
Removed:
################################################################################
diff --git a/lldb/test/API/lang/cpp/enum_promotion/main.cpp b/lldb/test/API/lang/cpp/enum_promotion/main.cpp
index bcdb0adff5d40..a250115eabc11 100644
--- a/lldb/test/API/lang/cpp/enum_promotion/main.cpp
+++ b/lldb/test/API/lang/cpp/enum_promotion/main.cpp
@@ -1,12 +1,12 @@
-enum EnumUChar { UChar = 1 };
-enum EnumUShort { UShort = 0x101 };
-enum EnumUInt { UInt = 0x10001 };
-enum EnumSLong { SLong = 0x100000001 };
-enum EnumULong { ULong = 0xFFFFFFFFFFFFFFF0 };
-enum EnumNChar { NChar = -1 };
-enum EnumNShort { NShort = -0x101 };
-enum EnumNInt { NInt = -0x10001 };
-enum EnumNLong { NLong = -0x100000001 };
+enum EnumUChar { UChar = 1 } e1;
+enum EnumUShort { UShort = 0x101 } e2;
+enum EnumUInt { UInt = 0x10001 } e3;
+enum EnumSLong { SLong = 0x100000001 } e4;
+enum EnumULong { ULong = 0xFFFFFFFFFFFFFFF0 } e5;
+enum EnumNChar { NChar = -1 } e6;
+enum EnumNShort { NShort = -0x101 } e7;
+enum EnumNInt { NInt = -0x10001 } e8;
+enum EnumNLong { NLong = -0x100000001 } e9;
int main() {
auto UChar_promoted = +EnumUChar::UChar;
More information about the lldb-commits
mailing list