[llvm] [ci][llvm] Run cross-project-tests on llvm/ changes (PR #188522)
Michael Buch via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 26 09:19:03 PDT 2026
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/188522
>From 55ba85bcb8d7c9c2f3f77673ffffd27f0ec365c4 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Thu, 26 Mar 2026 14:27:45 +0000
Subject: [PATCH 1/3] [cross-project-tests] Add `has-gdb` LIT feature
This patch adds a `has-gdb` LIT feature that I then use in the `REQUIRES` clause for `llgdb` tests.
These tests were failing because `llgdb.py` couldn't find `gdb` on the host when I tried enabling these tests on PR CI (https://github.com/llvm/llvm-project/issues/188775).
We should get `gdb` installed on the buildbots. But we should also be able to run the rest of the `cross-project-tests` in the meantime even if gdb isn't installed.
---
.../llgdb-tests/forward-declare-class.cpp | 1 +
.../debuginfo-tests/llgdb-tests/nested-struct.cpp | 2 ++
.../debuginfo-tests/llgdb-tests/nrvo-string.cpp | 2 ++
.../debuginfo-tests/llgdb-tests/sret.cpp | 2 ++
.../debuginfo-tests/llgdb-tests/static-member-2.cpp | 2 ++
.../debuginfo-tests/llgdb-tests/static-member.cpp | 2 ++
cross-project-tests/lit.cfg.py | 13 +++++++++++++
7 files changed, 24 insertions(+)
diff --git a/cross-project-tests/debuginfo-tests/llgdb-tests/forward-declare-class.cpp b/cross-project-tests/debuginfo-tests/llgdb-tests/forward-declare-class.cpp
index 130c439faec8c..1ce361b21f092 100644
--- a/cross-project-tests/debuginfo-tests/llgdb-tests/forward-declare-class.cpp
+++ b/cross-project-tests/debuginfo-tests/llgdb-tests/forward-declare-class.cpp
@@ -1,6 +1,7 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %test_debuginfo %s %t.o
// Radar 9168773
+// REQUIRES: system-darwin || has-gdb
// XFAIL: !system-darwin && gdb-clang-incompatibility
// DEBUGGER: ptype A
diff --git a/cross-project-tests/debuginfo-tests/llgdb-tests/nested-struct.cpp b/cross-project-tests/debuginfo-tests/llgdb-tests/nested-struct.cpp
index 08668d61d222c..01b7cf8d8c798 100644
--- a/cross-project-tests/debuginfo-tests/llgdb-tests/nested-struct.cpp
+++ b/cross-project-tests/debuginfo-tests/llgdb-tests/nested-struct.cpp
@@ -1,3 +1,5 @@
+// REQUIRES: system-darwin || has-gdb
+//
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %test_debuginfo %s %t.o
// XFAIL: !system-darwin && gdb-clang-incompatibility
diff --git a/cross-project-tests/debuginfo-tests/llgdb-tests/nrvo-string.cpp b/cross-project-tests/debuginfo-tests/llgdb-tests/nrvo-string.cpp
index 988c4ae2232ae..4139a1d99d6d3 100644
--- a/cross-project-tests/debuginfo-tests/llgdb-tests/nrvo-string.cpp
+++ b/cross-project-tests/debuginfo-tests/llgdb-tests/nrvo-string.cpp
@@ -1,3 +1,5 @@
+// REQUIRES: system-darwin || has-gdb
+//
// This ensures that DW_OP_deref is inserted when necessary, such as when NRVO
// of a string object occurs in C++.
//
diff --git a/cross-project-tests/debuginfo-tests/llgdb-tests/sret.cpp b/cross-project-tests/debuginfo-tests/llgdb-tests/sret.cpp
index 28f057b4e9b56..e0fd0072b31f7 100644
--- a/cross-project-tests/debuginfo-tests/llgdb-tests/sret.cpp
+++ b/cross-project-tests/debuginfo-tests/llgdb-tests/sret.cpp
@@ -1,3 +1,5 @@
+// REQUIRES: system-darwin || has-gdb
+//
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out
diff --git a/cross-project-tests/debuginfo-tests/llgdb-tests/static-member-2.cpp b/cross-project-tests/debuginfo-tests/llgdb-tests/static-member-2.cpp
index c9b416dace925..2fe1c79cbeaa6 100644
--- a/cross-project-tests/debuginfo-tests/llgdb-tests/static-member-2.cpp
+++ b/cross-project-tests/debuginfo-tests/llgdb-tests/static-member-2.cpp
@@ -1,3 +1,5 @@
+// REQUIRES: system-darwin || has-gdb
+//
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c
// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out
// RUN: %test_debuginfo %s %t.out
diff --git a/cross-project-tests/debuginfo-tests/llgdb-tests/static-member.cpp b/cross-project-tests/debuginfo-tests/llgdb-tests/static-member.cpp
index 492e0ca084209..d04868e14581d 100644
--- a/cross-project-tests/debuginfo-tests/llgdb-tests/static-member.cpp
+++ b/cross-project-tests/debuginfo-tests/llgdb-tests/static-member.cpp
@@ -1,3 +1,5 @@
+// REQUIRES: system-darwin || has-gdb
+//
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c
// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out
// RUN: %test_debuginfo %s %t.out
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index 158f172408b16..845965beec218 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -357,6 +357,19 @@ def set_apple_lldb_pre_1000_feature():
# platform and the installed gdb version.
dwarf_version_string = get_clang_default_dwarf_version_string(config.host_triple)
gdb_version_string = get_gdb_version_string()
+
+if gdb_version_string:
+ config.available_features.add("has-gdb")
+ print(
+ f"Found GDB version '{gdb_version_string}'",
+ file=sys.stderr,
+ )
+else:
+ print(
+ "No GDB found on host. Skipping tests that require GDB.",
+ file=sys.stderr,
+ )
+
if dwarf_version_string and gdb_version_string:
if int(dwarf_version_string) >= 5:
try:
>From 0f9cc2d08907c9dfc9d683935b13a1cf547fee16 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Wed, 25 Mar 2026 16:15:14 +0000
Subject: [PATCH 2/3] [ci][llvm] Test cross-project-tests on llvm/ changes
This patch ensures we run the `cross-project-tests` on `llvm/` PRs. At the very least those tests depend on debug-info and `llvm/ADT/`/`llvm/Support` (and the data-formatters that also live in `llvm/`).
This would've helped catch https://github.com/llvm/llvm-project/pull/188483 at pre-merge time.
---
.ci/compute_projects.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 9c7ad73710ae2..9bc7ace3e7e7c 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -48,6 +48,7 @@
"mlir",
"polly",
"flang",
+ "cross-project-tests",
},
"lld": {"bolt", "cross-project-tests"},
"clang": {"clang-tools-extra", "cross-project-tests", "lldb"},
>From 830cb9fdf2a48a353049b6465c9fdbd3447d8594 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Wed, 25 Mar 2026 16:23:04 +0000
Subject: [PATCH 3/3] fixup! un-exclude cross-project-tests
---
.ci/compute_projects.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 9bc7ace3e7e7c..fca359952a080 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -95,7 +95,6 @@
}
EXCLUDE_LINUX = {
- "cross-project-tests", # TODO(issues/132796): Tests are failing.
"openmp", # https://github.com/google/llvm-premerge-checks/issues/410
}
More information about the llvm-commits
mailing list