[Lldb-commits] [lldb] Revert "[lldb] Rally around triple rather than arch in the API tests (#191416)" (PR #192763)
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Fri Apr 17 19:53:39 PDT 2026
https://github.com/jasonmolenda created https://github.com/llvm/llvm-project/pull/192763
Temoprarily reverting while we look at the TestMacCatalyst.py and TestRosetta.py fails introduced by this PR, to unblock the CI.
This reverts commit 86397f49c7725f35a51517a8290cb4207c97771d.
>From 90248ad03004971ff05c7e32960ed96535abfe2c Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Fri, 17 Apr 2026 19:07:19 -0700
Subject: [PATCH] Revert "[lldb] Rally around triple rather than arch in the
API tests (#191416)"
Temoprarily reverting while we look at the TestMacCatalyst.py and
TestRosetta.py fails introduced by this PR, to unblock the CI.
This reverts commit 86397f49c7725f35a51517a8290cb4207c97771d.
---
.../Python/lldbsuite/test/builders/builder.py | 26 ++--
.../Python/lldbsuite/test/builders/darwin.py | 114 +++++++++++++-----
.../Python/lldbsuite/test/configuration.py | 3 +-
lldb/packages/Python/lldbsuite/test/dotest.py | 9 +-
.../Python/lldbsuite/test/dotest_args.py | 22 +++-
.../Python/lldbsuite/test/lldbplatformutil.py | 2 +-
.../Python/lldbsuite/test/make/Makefile.rules | 110 +++++++++++++----
.../expression/ptrauth-auth-traps/Makefile | 2 +
.../TestPtrAuthAuthTraps.py | 11 +-
.../commands/expression/ptrauth-objc/Makefile | 2 +
.../ptrauth-objc/TestPtrAuthObjectiveC.py | 17 +--
.../expression/ptrauth-vtable/Makefile | 2 +
.../TestPtrAuthVTableExpressions.py | 12 +-
.../API/commands/expression/ptrauth/Makefile | 2 +
.../ptrauth/TestPtrAuthExpressions.py | 15 +--
lldb/test/API/lang/c/ptrauth/Makefile | 1 +
lldb/test/API/lang/c/ptrauth/TestPtrAuth.py | 11 +-
17 files changed, 230 insertions(+), 131 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 03c1af579b018..00ead78096116 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -24,7 +24,8 @@ def getCompiler(self):
compiler = lldbutil.which(compiler)
return os.path.abspath(compiler)
- def getTriple(self):
+ def getTriple(self, arch):
+ """Returns the triple for the given architecture or None."""
return configuration.triple
def getExtraMakeArgs(self):
@@ -34,15 +35,11 @@ def getExtraMakeArgs(self):
"""
return []
- def getTripleSpec(self):
- """Returns the TRIPLE for the make system."""
- triple = self.getTriple()
- if triple:
- return ["TRIPLE=" + triple]
- return []
-
- def getArchCFlags(self):
+ def getArchCFlags(self, architecture):
"""Returns the ARCH_CFLAGS for the make system."""
+ triple = self.getTriple(architecture)
+ if triple:
+ return ["ARCH_CFLAGS=-target {}".format(triple)]
return []
def getMake(self, test_subdir, test_name):
@@ -98,6 +95,13 @@ def setOrAppendVariable(k, v):
return cmdline
+ def getArchSpec(self, architecture):
+ """
+ Helper function to return the key-value string to specify the architecture
+ used for the make system.
+ """
+ return ["ARCH=" + architecture] if architecture else []
+
def getToolchainSpec(self, compiler):
"""
Helper function to return the key-value strings to specify the toolchain
@@ -290,8 +294,8 @@ def getBuildCommand(
self.getMake(testdir, testname),
debug_info_args,
make_targets,
- self.getArchCFlags(),
- self.getTripleSpec(),
+ self.getArchCFlags(architecture),
+ self.getArchSpec(architecture),
self.getToolchainSpec(compiler),
self.getExtraMakeArgs(),
self.getSDKRootSpec(),
diff --git a/lldb/packages/Python/lldbsuite/test/builders/darwin.py b/lldb/packages/Python/lldbsuite/test/builders/darwin.py
index 786a1a4750437..eebe0ef47fd85 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/darwin.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/darwin.py
@@ -6,23 +6,69 @@
from lldbsuite.test import configuration
import lldbsuite.test.lldbutil as lldbutil
-TRIPLE_RE = re.compile(
- r"""^(?P<arch>[a-zA-Z0-9_]+) # arch (required)
- (?:-(?P<vendor>[a-zA-Z0-9_]+))? # vendor (optional)
- (?:-(?P<os>[a-zA-Z_]+)(?P<os_version>[\d.]+)?)? # os + version (optional)
- (?:-(?P<env>[a-zA-Z0-9_]+))? # env/abi (optional)
- $""",
- re.X,
-)
+REMOTE_PLATFORM_NAME_RE = re.compile(r"^remote-(.+)$")
+SIMULATOR_PLATFORM_RE = re.compile(r"^(.+)-simulator$")
-def split_triple(triple):
- if m := TRIPLE_RE.match(triple):
- return m.groups()
- return [None] * TRIPLE_RE.groups
+def get_os_env_from_platform(platform):
+ match = REMOTE_PLATFORM_NAME_RE.match(platform)
+ if match:
+ return match.group(1), ""
+ match = SIMULATOR_PLATFORM_RE.match(platform)
+ if match:
+ return match.group(1), "simulator"
+ return None, None
+
+
+def get_os_from_sdk(sdk):
+ return sdk[: sdk.find(".")], ""
+
+
+def get_os_and_env():
+ if configuration.lldb_platform_name:
+ return get_os_env_from_platform(configuration.lldb_platform_name)
+ if configuration.apple_sdk:
+ return get_os_from_sdk(configuration.apple_sdk)
+ return None, None
+
+
+def get_triple():
+ # Construct the vendor component.
+ vendor = "apple"
+
+ # Construct the os component.
+ os, env = get_os_and_env()
+ if os is None or env is None:
+ return None, None, None, None
+
+ # Get the SDK from the os and env.
+ sdk = lldbutil.get_xcode_sdk(os, env)
+ if sdk is None:
+ return None, None, None, None
+
+ # Get the version from the SDK.
+ version = lldbutil.get_xcode_sdk_version(sdk)
+ if version is None:
+ return None, None, None, None
+
+ return vendor, os, version, env
+
+
+def get_triple_str(arch, vendor, os, version, env):
+ if None in [arch, vendor, os, version, env]:
+ return None
+
+ component = [arch, vendor, os + version]
+ if env:
+ component.append(env)
+ return "-".join(component)
class BuilderDarwin(Builder):
+ def getTriple(self, arch):
+ vendor, os, version, env = get_triple()
+ return get_triple_str(arch, vendor, os, version, env)
+
def getExtraMakeArgs(self):
"""
Helper function to return extra argumentsfor the make system. This
@@ -41,37 +87,39 @@ def getExtraMakeArgs(self):
)
args["FRAMEWORK_INCLUDES"] = "-F{}".format(private_frameworks)
- if triple := self.getTriple():
- _, _, operating_system, _, env = split_triple(triple)
+ operating_system, env = get_os_and_env()
- builder_dir = os.path.dirname(os.path.abspath(__file__))
- test_dir = os.path.dirname(builder_dir)
- if operating_system in [None, "darwin", "macos", "macosx"]:
- entitlements_file = "entitlements-macos.plist"
+ builder_dir = os.path.dirname(os.path.abspath(__file__))
+ test_dir = os.path.dirname(builder_dir)
+ if not operating_system:
+ entitlements_file = "entitlements-macos.plist"
+ else:
+ if env == "simulator":
+ entitlements_file = "entitlements-simulator.plist"
else:
- if env == "simulator":
- entitlements_file = "entitlements-simulator.plist"
- else:
- entitlements_file = "entitlements.plist"
- entitlements = os.path.join(test_dir, "make", entitlements_file)
- args["CODESIGN"] = "codesign --entitlements {}".format(entitlements)
+ entitlements_file = "entitlements.plist"
+ entitlements = os.path.join(test_dir, "make", entitlements_file)
+ args["CODESIGN"] = "codesign --entitlements {}".format(entitlements)
# Return extra args as a formatted string.
return ["{}={}".format(key, value) for key, value in args.items()]
- def getArchCFlags(self):
- triple = self.getTriple()
+ def getArchCFlags(self, arch):
+ """Returns the ARCH_CFLAGS for the make system."""
+ # Get the triple components.
+ vendor, os, version, env = get_triple()
+ triple = get_triple_str(arch, vendor, os, version, env)
if not triple:
return []
- _, _, os, version, _ = split_triple(triple)
-
- if os == "darwin" or not version:
- return []
-
- target_os = "-mtargetos={}{}".format(os, version)
+ # Construct min version argument
+ version_min = ""
+ if env == "simulator":
+ version_min = "-m{}-simulator-version-min={}".format(os, version)
+ else:
+ version_min = "-m{}-version-min={}".format(os, version)
- return ["ARCH_CFLAGS={}".format(target_os)]
+ return ["ARCH_CFLAGS=-target {} {}".format(triple, version_min)]
def _getDebugInfoArgs(self, debug_info):
if debug_info == "dsym":
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index d1c933b35fcdf..dde1a5e52be47 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -39,8 +39,7 @@
# Test suite repeat count. Can be overwritten with '-# count'.
count = 1
-# The 'arch' is derived from the triple. The 'compiler' can be specified via
-# command line.
+# The 'arch' and 'compiler' can be specified via command line.
arch = None
compiler = None
dsymutil = None
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 7f73fce14bcdd..9b84375ba8e17 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -338,9 +338,12 @@ def parseOptionsAndInitTestdirs():
if args.triple:
configuration.triple = args.triple
- configuration.arch = (
- configuration.triple.split("-")[0] if configuration.triple else platform_machine
- )
+ if args.arch:
+ configuration.arch = args.arch
+ elif args.triple:
+ configuration.arch = args.triple.split("-")[0]
+ else:
+ configuration.arch = platform_machine
if args.categories_list:
configuration.categories_list = set(
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index f3b0837bdc4ab..4c0a67203755e 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -32,11 +32,12 @@ def create_parser():
# C and Python toolchain options
group = parser.add_argument_group("Toolchain options")
group.add_argument(
- "--triple",
- metavar="triple",
- dest="triple",
+ "-A",
+ "--arch",
+ metavar="arch",
+ dest="arch",
help=textwrap.dedent(
- """Specify the target triple to test with (e.g. x86_64-unknown-linux-gnu, arm64-apple-macosx)."""
+ """Specify the architecture(s) to test. This option can be specified more than once"""
),
)
group.add_argument(
@@ -57,6 +58,14 @@ def create_parser():
"""Specify the path to sysroot. This overrides apple_sdk sysroot."""
),
)
+ group.add_argument(
+ "--triple",
+ metavar="triple",
+ dest="triple",
+ help=textwrap.dedent(
+ """Specify the target triple. Used for cross compilation."""
+ ),
+ )
if sys.platform == "darwin":
group.add_argument(
"--apple-sdk",
@@ -85,12 +94,13 @@ def create_parser():
"Specify the path to a custom libc++ library directory. Must be used in conjunction with --libcxx-include-dir."
),
)
- # FIXME? This won't work for different extra flags according to each triple.
+ # FIXME? This won't work for different extra flags according to each arch.
group.add_argument(
"-E",
metavar="extra-flags",
help=textwrap.dedent(
- """Specify the extra flags to be passed to the toolchain when building the inferior programs to be debugged."""
+ """Specify the extra flags to be passed to the toolchain when building the inferior programs to be debugged
+ suggestions: do not lump the "-A arch1 -A arch2" together such that the -E option applies to only one of the architectures"""
),
)
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index a3fab6e49c2a7..39b52d6844bee 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -345,7 +345,7 @@ def getDwarfVersion():
return str(configuration.dwarf_version)
if "clang" in getCompiler():
try:
- triple = builder_module().getTriple()
+ triple = builder_module().getTriple(getArchitecture())
target = ["-target", triple] if triple else []
driver_output = subprocess.check_output(
[getCompiler()] + target + "-g -c -x c - -o - -###".split(),
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 5cff3f5d91539..6c197a2317bf7 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -109,32 +109,24 @@ else
endif
#----------------------------------------------------------------------
-# Determine the target triple. The triple is the canonical way to
-# specify the target. When only ARCH is provided we query the compiler
-# for its default triple and replace the arch component.
+# If TRIPLE is not defined try to set the ARCH, CC, CFLAGS, and more
+# from the triple alone
#----------------------------------------------------------------------
ARCH_CFLAGS :=
ifeq "$(OS)" "Android"
include $(THIS_FILE_DIR)/Android.rules
endif
-ifeq "$(TRIPLE)" ""
- ifeq "$(ARCH)" ""
- # No triple, no arch: query the compiler for its default triple.
- TRIPLE := $(shell $(CC) --print-target-triple)
- else
- # ARCH but no TRIPLE: replace the arch in the compiler's default triple.
- TRIPLE := $(shell $(CC) --print-target-triple | sed 's/^[^-]*/$(ARCH)/')
- endif
-endif
-
-# Derive ARCH from the first component of the triple if not already set.
+#----------------------------------------------------------------------
+# If ARCH is not defined, default to x86_64.
+#----------------------------------------------------------------------
ifeq "$(ARCH)" ""
- ARCH := $(firstword $(subst -, ,$(TRIPLE)))
+ifeq "$(OS)" "Windows_NT"
+ ARCH = x86
+else
+ ARCH = x86_64
+endif
endif
-
-# Use -target to pass the triple to the compiler.
-ARCH_CFLAGS := -target $(TRIPLE)
#----------------------------------------------------------------------
# CC defaults to clang.
@@ -190,10 +182,12 @@ ifeq "$(HOST_OS)" "Darwin"
endif
endif
-# Detect x86 from ARCH.
-ifneq (,$(filter amd64 x86_64 x64 x86 i386 i686,$(ARCH)))
- IS_X86 := 1
-endif
+
+#----------------------------------------------------------------------
+# ARCHFLAG is the flag used to tell the compiler which architecture
+# to compile for. The default is the flag that clang accepts.
+#----------------------------------------------------------------------
+ARCHFLAG ?= -arch
#----------------------------------------------------------------------
# Change any build/tool options needed
@@ -204,6 +198,68 @@ ifeq "$(OS)" "Darwin"
DSYM = $(EXE).dSYM
ARFLAGS := -static -o
else
+ # On non-Apple platforms, -arch becomes -m
+ ARCHFLAG := -m
+
+ # i386, i686, x86 -> 32
+ # amd64, x86_64, x64 -> 64
+ ifeq "$(ARCH)" "amd64"
+ override ARCH := $(subst amd64,64,$(ARCH))
+ IS_X86 := 1
+ endif
+ ifeq "$(ARCH)" "x86_64"
+ override ARCH := $(subst x86_64,64,$(ARCH))
+ IS_X86 := 1
+ endif
+ ifeq "$(ARCH)" "x64"
+ override ARCH := $(subst x64,64,$(ARCH))
+ IS_X86 := 1
+ endif
+ ifeq "$(ARCH)" "x86"
+ override ARCH := $(subst x86,32,$(ARCH))
+ IS_X86 := 1
+ endif
+ ifeq "$(ARCH)" "i386"
+ override ARCH := $(subst i386,32,$(ARCH))
+ IS_X86 := 1
+ endif
+ ifeq "$(ARCH)" "i686"
+ override ARCH := $(subst i686,32,$(ARCH))
+ IS_X86 := 1
+ endif
+ ifeq "$(ARCH)" "powerpc"
+ override ARCH := $(subst powerpc,32,$(ARCH))
+ endif
+ ifeq "$(ARCH)" "powerpc64"
+ override ARCH := $(subst powerpc64,64,$(ARCH))
+ endif
+ ifeq "$(ARCH)" "powerpc64le"
+ override ARCH := $(subst powerpc64le,64,$(ARCH))
+ endif
+ ifeq "$(ARCH)" "aarch64"
+ override ARCH :=
+ override ARCHFLAG :=
+ endif
+ ifeq "$(findstring arm,$(ARCH))" "arm"
+ override ARCH :=
+ override ARCHFLAG :=
+ endif
+ ifeq "$(ARCH)" "s390x"
+ override ARCH :=
+ override ARCHFLAG :=
+ endif
+ ifeq "$(ARCH)" "riscv"
+ override ARCH :=
+ override ARCHFLAG :=
+ endif
+ ifeq "$(findstring mips,$(ARCH))" "mips"
+ override ARCHFLAG := -
+ endif
+ ifeq "$(findstring loongarch,$(ARCH))" "loongarch"
+ override ARCH :=
+ override ARCHFLAG :=
+ endif
+
ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
DSYM = $(EXE).debug
endif
@@ -240,7 +296,9 @@ CFLAGS ?= $(DEBUG_INFO_FLAG) -O0
CFLAGS += $(SYSROOT_FLAGS)
ifeq "$(OS)" "Darwin"
- CFLAGS += $(FRAMEWORK_INCLUDES)
+ CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES)
+else
+ CFLAGS += $(ARCHFLAG)$(ARCH)
endif
CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include
@@ -253,7 +311,11 @@ endif
CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS)
# Use this one if you want to build one part of the result without debug information:
-CFLAGS_NO_DEBUG = -O0 $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS)
+ifeq "$(OS)" "Darwin"
+ CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS)
+else
+ CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS)
+endif
ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
diff --git a/lldb/test/API/commands/expression/ptrauth-auth-traps/Makefile b/lldb/test/API/commands/expression/ptrauth-auth-traps/Makefile
index 10495940055b6..ac50baa81423e 100644
--- a/lldb/test/API/commands/expression/ptrauth-auth-traps/Makefile
+++ b/lldb/test/API/commands/expression/ptrauth-auth-traps/Makefile
@@ -1,3 +1,5 @@
C_SOURCES := main.c
+override ARCH := arm64e
+
include Makefile.rules
diff --git a/lldb/test/API/commands/expression/ptrauth-auth-traps/TestPtrAuthAuthTraps.py b/lldb/test/API/commands/expression/ptrauth-auth-traps/TestPtrAuthAuthTraps.py
index 411c352b41ec4..5e9f0c4cd01a1 100644
--- a/lldb/test/API/commands/expression/ptrauth-auth-traps/TestPtrAuthAuthTraps.py
+++ b/lldb/test/API/commands/expression/ptrauth-auth-traps/TestPtrAuthAuthTraps.py
@@ -8,21 +8,14 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-from lldbsuite.test import configuration
class TestPtrAuthAuthTraps(TestBase):
NO_DEBUG_INFO_TESTCASE = True
- SHARED_BUILD_TESTCASE = False
-
- def build_arm64e(self):
- self.build(
- dictionary={"TRIPLE": configuration.triple.replace("arm64", "arm64e")}
- )
@skipUnlessArm64eSupported
def test_static_function_pointer(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.c", False)
)
@@ -39,7 +32,7 @@ def test_static_function_pointer(self):
@skipUnlessArm64eSupported
def test_indirect_call_through_caller(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.c", False)
)
diff --git a/lldb/test/API/commands/expression/ptrauth-objc/Makefile b/lldb/test/API/commands/expression/ptrauth-objc/Makefile
index 8e9302ac72ca8..496df2948ac1b 100644
--- a/lldb/test/API/commands/expression/ptrauth-objc/Makefile
+++ b/lldb/test/API/commands/expression/ptrauth-objc/Makefile
@@ -1,5 +1,7 @@
OBJC_SOURCES := main.m
+override ARCH := arm64e
+
# We need an arm64e stdlib.
USE_SYSTEM_STDLIB := 1
diff --git a/lldb/test/API/commands/expression/ptrauth-objc/TestPtrAuthObjectiveC.py b/lldb/test/API/commands/expression/ptrauth-objc/TestPtrAuthObjectiveC.py
index d9a3685c81087..0f4b50d126d51 100644
--- a/lldb/test/API/commands/expression/ptrauth-objc/TestPtrAuthObjectiveC.py
+++ b/lldb/test/API/commands/expression/ptrauth-objc/TestPtrAuthObjectiveC.py
@@ -2,21 +2,14 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-from lldbsuite.test import configuration
class TestPtrAuthObjectiveC(TestBase):
NO_DEBUG_INFO_TESTCASE = True
- SHARED_BUILD_TESTCASE = False
-
- def build_arm64e(self):
- self.build(
- dictionary={"TRIPLE": configuration.triple.replace("arm64", "arm64e")}
- )
@skipUnlessArm64eSupported
def test_objc_message_send(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.m", False)
@@ -30,7 +23,7 @@ def test_objc_message_send(self):
@skipUnlessArm64eSupported
def test_objc_message_send_with_arg(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.m", False)
@@ -44,7 +37,7 @@ def test_objc_message_send_with_arg(self):
@skipUnlessArm64eSupported
def test_objc_alloc_and_message(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.m", False)
@@ -59,7 +52,7 @@ def test_objc_alloc_and_message(self):
@skipUnlessArm64eSupported
def test_objc_derived_class(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.m", False)
@@ -79,7 +72,7 @@ def test_objc_derived_class(self):
@skipUnlessArm64eSupported
def test_objc_isa_check(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.m", False)
diff --git a/lldb/test/API/commands/expression/ptrauth-vtable/Makefile b/lldb/test/API/commands/expression/ptrauth-vtable/Makefile
index 5ac5d6a2a7365..3c6bc2dd007e1 100644
--- a/lldb/test/API/commands/expression/ptrauth-vtable/Makefile
+++ b/lldb/test/API/commands/expression/ptrauth-vtable/Makefile
@@ -1,5 +1,7 @@
CXX_SOURCES := main.cpp
+override ARCH := arm64e
+
# We need an arm64e stblib.
USE_SYSTEM_STDLIB := 1
diff --git a/lldb/test/API/commands/expression/ptrauth-vtable/TestPtrAuthVTableExpressions.py b/lldb/test/API/commands/expression/ptrauth-vtable/TestPtrAuthVTableExpressions.py
index 7376f5b7f3484..92a30b6e6548f 100644
--- a/lldb/test/API/commands/expression/ptrauth-vtable/TestPtrAuthVTableExpressions.py
+++ b/lldb/test/API/commands/expression/ptrauth-vtable/TestPtrAuthVTableExpressions.py
@@ -12,16 +12,10 @@
class TestPtrAuthVTableExpressions(TestBase):
NO_DEBUG_INFO_TESTCASE = True
- SHARED_BUILD_TESTCASE = False
-
- def build_arm64e(self):
- self.build(
- dictionary={"TRIPLE": configuration.triple.replace("arm64", "arm64e")}
- )
@skipUnlessArm64eSupported
def test_virtual_call_on_debuggee_object(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.cpp", False)
)
@@ -31,7 +25,7 @@ def test_virtual_call_on_debuggee_object(self):
@skipUnlessArm64eSupported
def test_virtual_call_through_base_pointer(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.cpp", False)
)
@@ -40,7 +34,7 @@ def test_virtual_call_through_base_pointer(self):
@skipUnlessArm64eSupported
def test_virtual_call_via_helper(self):
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.cpp", False)
)
diff --git a/lldb/test/API/commands/expression/ptrauth/Makefile b/lldb/test/API/commands/expression/ptrauth/Makefile
index 10495940055b6..ac50baa81423e 100644
--- a/lldb/test/API/commands/expression/ptrauth/Makefile
+++ b/lldb/test/API/commands/expression/ptrauth/Makefile
@@ -1,3 +1,5 @@
C_SOURCES := main.c
+override ARCH := arm64e
+
include Makefile.rules
diff --git a/lldb/test/API/commands/expression/ptrauth/TestPtrAuthExpressions.py b/lldb/test/API/commands/expression/ptrauth/TestPtrAuthExpressions.py
index 160c04f38a0a1..4d0d4026cc0c4 100644
--- a/lldb/test/API/commands/expression/ptrauth/TestPtrAuthExpressions.py
+++ b/lldb/test/API/commands/expression/ptrauth/TestPtrAuthExpressions.py
@@ -2,17 +2,10 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-from lldbsuite.test import configuration
class TestPtrAuthExpressions(TestBase):
NO_DEBUG_INFO_TESTCASE = True
- SHARED_BUILD_TESTCASE = False
-
- def build_arm64e(self):
- self.build(
- dictionary={"TRIPLE": configuration.triple.replace("arm64", "arm64e")}
- )
@skipUnlessArm64eSupported
def test_static_function_pointer(self):
@@ -20,7 +13,7 @@ def test_static_function_pointer(self):
Test that we can call a function through a static function pointer
from the expression evaluator, which requires "fixing up" the pointer
signing via the InjectPointerSigningFixups pass."""
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.c", False)
@@ -44,7 +37,7 @@ def test_indirect_call_through_caller(self):
correctly signed. The caller() function in the debuggee forces a
genuine indirect call, preventing the compiler from folding the
function pointer call into a direct call."""
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.c", False)
@@ -69,7 +62,7 @@ def test_debuggee_signed_pointer(self):
is signed with the IB key (__ptrauth(1, 0, 0)), which is
process-specific; this verifies that auth succeeds because expressions
execute in the debuggee's process, not the debugger's."""
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.c", False)
@@ -86,7 +79,7 @@ def test_indirect_goto(self):
"""Test that computed gotos (GCC labels-as-values) work in the
expression evaluator on arm64e, where -fptrauth-indirect-gotos signs
label addresses and the indirect branch authenticates them."""
- self.build_arm64e()
+ self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.c", False)
diff --git a/lldb/test/API/lang/c/ptrauth/Makefile b/lldb/test/API/lang/c/ptrauth/Makefile
index 8c13eda0b791e..0b4de8245f908 100644
--- a/lldb/test/API/lang/c/ptrauth/Makefile
+++ b/lldb/test/API/lang/c/ptrauth/Makefile
@@ -1,4 +1,5 @@
LEVEL = ../../../make
+override ARCH := arm64e
CFLAGS_EXTRAS = -fptrauth-calls -fptrauth-intrinsics
C_SOURCES := main.c
diff --git a/lldb/test/API/lang/c/ptrauth/TestPtrAuth.py b/lldb/test/API/lang/c/ptrauth/TestPtrAuth.py
index efed7e2a5ad6f..a69bb1cfe33a6 100644
--- a/lldb/test/API/lang/c/ptrauth/TestPtrAuth.py
+++ b/lldb/test/API/lang/c/ptrauth/TestPtrAuth.py
@@ -4,21 +4,12 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-from lldbsuite.test import configuration
class TestPtrAuth(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
- SHARED_BUILD_TESTCASE = False
-
- def build_arm64e(self):
- self.build(
- dictionary={"TRIPLE": configuration.triple.replace("arm64", "arm64e")}
- )
-
@skipUnlessArm64eSupported
def test(self):
- self.build_arm64e()
+ self.build()
_, process, _, _ = lldbutil.run_to_source_breakpoint(
self, "// break in main", lldb.SBFileSpec("main.c")
)
More information about the lldb-commits
mailing list