[llvm] [orc-rt] Generalize testcases for different target archs (PR #222629)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 05:36:32 PDT 2026


https://github.com/lhames created https://github.com/llvm/llvm-project/pull/222629

Drop the hard-coded archs from the check-rt-process-info testcases. Instead, check against an arch value derived from the build's target triple.

>From ec974370ca7cdde7e05ee32a825bf1626c6834d1 Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at apple.com>
Date: Thu, 10 Sep 2026 22:30:06 +1000
Subject: [PATCH] [orc-rt] Generalize testcases for different target archs

Drop the hard-coded archs from the check-rt-process-info testcases.
Instead, check against an arch value derived from the build's target
triple.
---
 orc-rt/test/regression/darwin/check-rt-process-info.test | 6 +++---
 orc-rt/test/regression/linux/check-rt-process-info.test  | 5 +++--
 orc-rt/test/regression/lit.cfg.py                        | 5 +++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/orc-rt/test/regression/darwin/check-rt-process-info.test b/orc-rt/test/regression/darwin/check-rt-process-info.test
index 1950df9ec5f93..8df2c09477c89 100644
--- a/orc-rt/test/regression/darwin/check-rt-process-info.test
+++ b/orc-rt/test/regression/darwin/check-rt-process-info.test
@@ -1,6 +1,6 @@
 # RUN: orc-rt-process-info-check --print-triple --print-cpu-features --print-page-size  \
-# RUN:   | FileCheck %s -DVERSION=%macos-product-version
+# RUN:   | FileCheck %s -DARCH=%target-arch -DVERSION=%macos-product-version
 
-# CHECK: {{arm64e?}}-apple-macosx[[VERSION]]
+# CHECK: [[ARCH]]-apple-macosx[[VERSION]]
 # CHECK-NEXT: {{4096|16384}}
-# CHECK-NEXT: {{(\+[a-z0-9_.]+,)*\+neon(,\+[a-z0-9_.]+)*}}
+# CHECK-NEXT: {{^\+[a-z0-9_.]+(,\+[a-z0-9_.]+)*$}}
diff --git a/orc-rt/test/regression/linux/check-rt-process-info.test b/orc-rt/test/regression/linux/check-rt-process-info.test
index 04bf20a94aa8d..160be336d40cf 100644
--- a/orc-rt/test/regression/linux/check-rt-process-info.test
+++ b/orc-rt/test/regression/linux/check-rt-process-info.test
@@ -1,4 +1,5 @@
-# RUN: orc-rt-process-info-check --print-triple --print-page-size | FileCheck %s
+# RUN: orc-rt-process-info-check --print-triple --print-page-size \
+# RUN:   | FileCheck %s -DARCH=%target-arch
 
-# CHECK: -linux
+# CHECK: {{^}}[[ARCH]]-{{.*}}-linux
 # CHECK-NEXT: {{4096|16384}}
diff --git a/orc-rt/test/regression/lit.cfg.py b/orc-rt/test/regression/lit.cfg.py
index fa99beabb1fb1..423a3e0b2fc6d 100644
--- a/orc-rt/test/regression/lit.cfg.py
+++ b/orc-rt/test/regression/lit.cfg.py
@@ -90,3 +90,8 @@ def add_logging_features():
 if platform.system() == "Darwin":
     config.substitutions.append(("%macos-product-version", platform.mac_ver()[0]))
 config.substitutions.append(("%target_triple", config.target_triple))
+
+# The architecture the runtime was built for, so tests can check the triple it
+# reports against an independent source.
+config.substitutions.append(
+    ("%target-arch", config.target_triple.split("-")[0]))



More information about the llvm-commits mailing list