Skip to content

Commit 503944f

Browse files
authored
Merge pull request #3924 from apple/jdevlieghere/fix-lldb-server-tests-on-as
Fix a few lldb-server tests on Apple Silicon
2 parents 0f172e8 + 85467c9 commit 503944f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,17 +1535,18 @@ def single_step_only_steps_one_instruction(
15351535
# variable value
15361536
if re.match("s390x", arch):
15371537
expected_step_count = 2
1538-
# ARM64 requires "4" instructions: 2 to compute the address (adrp, add),
1539-
# one to materialize the constant (mov) and the store
1538+
# ARM64 requires "4" instructions: 2 to compute the address (adrp,
1539+
# add), one to materialize the constant (mov) and the store. Once
1540+
# addresses and constants are materialized, only one instruction is
1541+
# needed.
15401542
if re.match("arm64", arch):
1541-
expected_step_count = 4
1542-
1543-
self.assertEqual(step_count, expected_step_count)
1544-
1545-
# ARM64: Once addresses and constants are materialized, only one
1546-
# instruction is needed.
1547-
if re.match("arm64", arch):
1548-
expected_step_count = 1
1543+
before_materialization_step_count = 4
1544+
after_matrialization_step_count = 1
1545+
self.assertIn(step_count, [before_materialization_step_count,
1546+
after_matrialization_step_count])
1547+
expected_step_count = after_matrialization_step_count
1548+
else:
1549+
self.assertEqual(step_count, expected_step_count)
15491550

15501551
# Verify we hit the next state.
15511552
args["expected_g_c1"] = "0"

lldb/test/API/tools/lldb-server/memory-allocation/TestGdbRemoteMemoryAllocation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def allocate(self, size, permissions):
4444

4545
@skipIf(oslist=no_match(supported_oses))
4646
@skipIf(oslist=["linux"], archs=no_match(supported_linux_archs))
47+
@expectedFailureDarwin(archs=["arm64", "arm64e"]) # Memory cannot be writable and executable
4748
@expectedFailureAll(oslist=["windows"]) # Memory allocated with incorrect permissions
4849
def test_supported(self):
4950
"""Make sure (de)allocation works on platforms where it's supposed to

0 commit comments

Comments
 (0)