Skip to content

Commit 194b844

Browse files
fixup! address review feedback
1 parent 73e767b commit 194b844

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lldb/test/API/macosx/arm-pointer-metadata-cfa-dwarf-expr/TestArmPointerMetadataCFADwarfExpr.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@ def test(self):
1515
# toggle the bit of fp and save it on the stack:
1616
# orr x29, x29, #0x1000000000000000
1717
# stp x29, x30, [sp, #-16]!
18+
# This is effectively adding metadata to the CFA of the caller frame (main).
1819
thread.StepInstruction(False)
1920
thread.StepInstruction(False)
2021

22+
# The location of `argv` has been artificially made equal to the CFA of the frame.
23+
# As such, it should have the metadata artificially set previously.
2124
argv_addr = thread.frames[1].GetValueForVariablePath("&argv")
2225
self.assertTrue(argv_addr.IsValid())
23-
2426
argv_addr_uint = argv_addr.GetValueAsUnsigned()
2527
self.assertNotEqual((argv_addr_uint & (1 << 60)), 0)
28+
29+
# GetCFA strips metadata.
30+
cfa = thread.frames[1].GetCFA()
31+
self.assertEqual((cfa & (1 << 60)), 0)
32+
33+
# If the test worked correctly, the cfa and the location should be identical,
34+
# modulo the metadata.
35+
self.assertEqual(cfa | (1 << 60), argv_addr_uint)

0 commit comments

Comments
 (0)