Skip to content

Commit 4eb4211

Browse files
authored
[lldb][test] TestConstStaticIntegralMember: relax assertion on number of global variables (#73707)
In #73626 we started attaching `DW_AT_const_value`s on a static data-member's declaration again. In DWARFv5, those static members are represented with a `DW_TAG_variable`. When LLDB builds the `ManualDWARFIndex`, it simply iterates over all DIEs in a CU and puts *any* `DW_TAG_variable` with a constant or location into the index. So when using the manual index, we can end up having 2 entries for a static data member in the index, one for the declaration and one for the definition. This caused a test failure on Linux (where DWARFv5 is the default and the tests use the manual index). This patch loosens the restriction that we find exactly 1 variable.
1 parent 110f927 commit 4eb4211

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def test_class_with_only_const_static(self):
118118

119119
def check_global_var(self, name: str, expect_type, expect_val):
120120
var_list = self.target().FindGlobalVariables(name, lldb.UINT32_MAX)
121-
self.assertEqual(len(var_list), 1)
121+
self.assertGreaterEqual(len(var_list), 1)
122122
varobj = var_list[0]
123123
self.assertEqual(varobj.type.name, expect_type)
124124
self.assertEqual(varobj.value, expect_val)

0 commit comments

Comments
 (0)