Skip to content

Commit 73ce2fe

Browse files
authored
Cherry-pick fix for darwin-related tests' XFAIL annotations (#216)
This cherry-picks the upstream change from llvm/llvm-project#130144, which landed on the `main` branch, into our 20.x release. The change is included as a patch file for llvm.
1 parent e479def commit 73ce2fe

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 50da06f400c6fd5a959d4ae9fafb8b1ba23540a8 Mon Sep 17 00:00:00 2001
2+
From: Lucas Duarte Prates <[email protected]>
3+
Date: Fri, 7 Mar 2025 10:53:10 +0000
4+
Subject: [llvm-ar] Fix darwin-related tests' XFAIL annotation (#130144)
5+
6+
The tests updated by this commit are expected to fail when targetting a
7+
darwin platform. As they rely on target detection based on the host,
8+
this is currently checked by using the `XFAIL: system-darwin`
9+
annotation.
10+
11+
This approach becomes a problem when trying to run such tests on a
12+
cross-compiling build of clang on a darwin platform. When no darwin
13+
targets are included in the build, the XFAIL will still apply even
14+
though the target used is not related to the darwin platform, and the
15+
tests will unexpectedly pass.
16+
17+
To fix this issue, this patch updates the condition used by the tests'
18+
XFAIL annotation to `target={{.*}}-darwin{{.*}}`, ensuring they only are
19+
xfailed when the relevant target is used.
20+
21+
(cherry picked from commit dc69eae1c47a0545ae8c3129e44a8fa662612d7c)
22+
---
23+
llvm/test/tools/llvm-ar/extract.test | 2 +-
24+
llvm/test/tools/llvm-ar/print.test | 2 +-
25+
2 files changed, 2 insertions(+), 2 deletions(-)
26+
27+
diff --git a/llvm/test/tools/llvm-ar/extract.test b/llvm/test/tools/llvm-ar/extract.test
28+
index ccad703f3a14..bf46cc0743c7 100644
29+
--- a/llvm/test/tools/llvm-ar/extract.test
30+
+++ b/llvm/test/tools/llvm-ar/extract.test
31+
@@ -1,5 +1,5 @@
32+
## Test extract operation.
33+
-# XFAIL: system-darwin
34+
+# XFAIL: target={{.*}}-darwin{{.*}}
35+
36+
# RUN: rm -rf %t && mkdir -p %t/extracted/
37+
38+
diff --git a/llvm/test/tools/llvm-ar/print.test b/llvm/test/tools/llvm-ar/print.test
39+
index a27cab4a227e..997c05f225a8 100644
40+
--- a/llvm/test/tools/llvm-ar/print.test
41+
+++ b/llvm/test/tools/llvm-ar/print.test
42+
@@ -1,5 +1,5 @@
43+
## Test Print output
44+
-# XFAIL: system-darwin
45+
+# XFAIL: target={{.*}}-darwin{{.*}}
46+
47+
# RUN: rm -rf %t && mkdir -p %t
48+
# RUN: echo file1 > %t/1.txt
49+
--
50+
2.47.1
51+

0 commit comments

Comments
 (0)