[Lldb-commits] [lldb] [lldb][test] Enable non-address bit WritePointerToMemory test on Linux (PR #157435)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 8 05:07:18 PDT 2025
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/157435
First added in #153585 for Darwin only. All Linux AArch64 systems also have Top Byte Ignore enabled in userspace so the test "just works" there.
FreeBSD has very recently gained Top Byte Ignore support: https://github.com/freebsd/freebsd-src/commit/4c6c27d3fb4ad15931aae2eaf8e624aed99a3fd9
However it's so recent, I don't want to assume it'll be available on any random FreeBSD system out there.
There isn't really a good place to put this test, so I put it in the top level of API, next to the other non-address bit test that didn't have a good home either.
>From 528fbe2b518b586283ffa6ce93674dbf346687d7 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Mon, 8 Sep 2025 12:03:58 +0000
Subject: [PATCH] [lldb][test] Enable non-address bit WritePointerToMemory test
on Linux
First added in #153585 for Darwin only. All Linux AArch64 systems also
have Top Byte Ignore enabled in userspace so the test "just works" there.
FreeBSD has very recently gained Top Byte Ignore support:
https://github.com/freebsd/freebsd-src/commit/4c6c27d3fb4ad15931aae2eaf8e624aed99a3fd9
However it's so recent, I don't want to assume it'll be available on
any random FreeBSD system out there.
There isn't really a good place to put this test, so I put it in the
top level of API, next to the other non-address bit test that didn't
have a good home either.
---
.../Makefile | 0
.../TestArmPointerMetadataStripping.py | 8 +++++---
.../extra_symbols.json | 0
.../main.c | 0
4 files changed, 5 insertions(+), 3 deletions(-)
rename lldb/test/API/{macosx/arm-pointer-metadata-stripping => pointer-nonaddressable-bits}/Makefile (100%)
rename lldb/test/API/{macosx/arm-pointer-metadata-stripping => pointer-nonaddressable-bits}/TestArmPointerMetadataStripping.py (82%)
rename lldb/test/API/{macosx/arm-pointer-metadata-stripping => pointer-nonaddressable-bits}/extra_symbols.json (100%)
rename lldb/test/API/{macosx/arm-pointer-metadata-stripping => pointer-nonaddressable-bits}/main.c (100%)
diff --git a/lldb/test/API/macosx/arm-pointer-metadata-stripping/Makefile b/lldb/test/API/pointer-nonaddressable-bits/Makefile
similarity index 100%
rename from lldb/test/API/macosx/arm-pointer-metadata-stripping/Makefile
rename to lldb/test/API/pointer-nonaddressable-bits/Makefile
diff --git a/lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py b/lldb/test/API/pointer-nonaddressable-bits/TestArmPointerMetadataStripping.py
similarity index 82%
rename from lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py
rename to lldb/test/API/pointer-nonaddressable-bits/TestArmPointerMetadataStripping.py
index f61945b3eb4c9..21caf7195412a 100644
--- a/lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py
+++ b/lldb/test/API/pointer-nonaddressable-bits/TestArmPointerMetadataStripping.py
@@ -5,9 +5,11 @@
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-
- at skipUnlessDarwin
- at skipIf(archs=no_match(["arm64", "arm64e"]))
+# On AArch64 systems, unused top bits of pointers can be used for other things.
+ at skipIf(archs=no_match(["aarch64", "arm64", "arm64e"]))
+# Only run this test on systems where Top Byte Ignore is known to be enabled
+# and widely available (FreeBSD has support but only since recently).
+ at skipUnlessPlatform(["linux"] + lldbplatformutil.getDarwinOSTriples())
class TestArmPointerMetadataStripping(TestBase):
# Use extra_symbols.json as a template to add a new symbol whose address
# contains non-zero high order bits set.
diff --git a/lldb/test/API/macosx/arm-pointer-metadata-stripping/extra_symbols.json b/lldb/test/API/pointer-nonaddressable-bits/extra_symbols.json
similarity index 100%
rename from lldb/test/API/macosx/arm-pointer-metadata-stripping/extra_symbols.json
rename to lldb/test/API/pointer-nonaddressable-bits/extra_symbols.json
diff --git a/lldb/test/API/macosx/arm-pointer-metadata-stripping/main.c b/lldb/test/API/pointer-nonaddressable-bits/main.c
similarity index 100%
rename from lldb/test/API/macosx/arm-pointer-metadata-stripping/main.c
rename to lldb/test/API/pointer-nonaddressable-bits/main.c
More information about the lldb-commits
mailing list