Skip to content

Commit 0feb00f

Browse files
committed
[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.
1 parent c52fbab commit 0feb00f

File tree

1 file changed

+9
-9
lines changed
  • lldb/test/API/lang/cpp/enum_promotion

1 file changed

+9
-9
lines changed

lldb/test/API/lang/cpp/enum_promotion/main.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
enum EnumUChar { UChar = 1 };
2-
enum EnumUShort { UShort = 0x101 };
3-
enum EnumUInt { UInt = 0x10001 };
4-
enum EnumSLong { SLong = 0x100000001 };
5-
enum EnumULong { ULong = 0xFFFFFFFFFFFFFFF0 };
6-
enum EnumNChar { NChar = -1 };
7-
enum EnumNShort { NShort = -0x101 };
8-
enum EnumNInt { NInt = -0x10001 };
9-
enum EnumNLong { NLong = -0x100000001 };
1+
enum EnumUChar { UChar = 1 } e1;
2+
enum EnumUShort { UShort = 0x101 } e2;
3+
enum EnumUInt { UInt = 0x10001 } e3;
4+
enum EnumSLong { SLong = 0x100000001 } e4;
5+
enum EnumULong { ULong = 0xFFFFFFFFFFFFFFF0 } e5;
6+
enum EnumNChar { NChar = -1 } e6;
7+
enum EnumNShort { NShort = -0x101 } e7;
8+
enum EnumNInt { NInt = -0x10001 } e8;
9+
enum EnumNLong { NLong = -0x100000001 } e9;
1010

1111
int main() {
1212
auto UChar_promoted = +EnumUChar::UChar;

0 commit comments

Comments
 (0)