[llvm] [test] llvm-ar: Fix inadvertent unXFAIL for Apple platforms (PR #159796)
Anthony Latsis via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 7 13:50:35 PDT 2025
https://github.com/AnthonyLatsis updated https://github.com/llvm/llvm-project/pull/159796
>From a800d13b0425f463439ffd8f7afd8be833a6581c Mon Sep 17 00:00:00 2001
From: Anthony Latsis <alatsis at apple.com>
Date: Fri, 19 Sep 2025 15:44:50 +0100
Subject: [PATCH] [test] llvm-ar: Adjust 2 tests to pass again after
inadvertent unXFAIL for some target triples
The problem with the current `target={{.*}}-darwin{{.*}}` XFAIL
condition (changed in https://github.com/llvm/llvm-project/pull/130144)
is that the Swift build script uses Apple platform names like 'macosx',
not 'darwin', for the LLVM target triple, e.g. `arm64-apple-macosx13.0`.
These tests appear to have been originally XFAILed because the default
format on macOS (darwin) adds newlines as padding to align members.
See: https://github.com/llvm/llvm-project/blob/ee8394d9469a2946ffe2e7d192c593ecf3f93098/llvm/lib/Object/ArchiveWriter.cpp#L897-L904
Use `--format=gnu` to cope with the differences in the output and
reenable the tests.
---
llvm/test/tools/llvm-ar/extract.test | 3 +--
llvm/test/tools/llvm-ar/print.test | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/llvm/test/tools/llvm-ar/extract.test b/llvm/test/tools/llvm-ar/extract.test
index bf46cc0743c7d..f8be7fd2b0cb4 100644
--- a/llvm/test/tools/llvm-ar/extract.test
+++ b/llvm/test/tools/llvm-ar/extract.test
@@ -1,5 +1,4 @@
## Test extract operation.
-# XFAIL: target={{.*}}-darwin{{.*}}
# RUN: rm -rf %t && mkdir -p %t/extracted/
@@ -9,7 +8,7 @@
# RUN: echo filea > %t/a.txt
# RUN: echo fileb > %t/b.txt
-# RUN: llvm-ar rc %t/archive.a %t/a.txt %t/b.txt
+# RUN: llvm-ar rc --format=gnu %t/archive.a %t/a.txt %t/b.txt
## Single member:
# RUN: cd %t/extracted && llvm-ar xv %t/archive.a a.txt | FileCheck %s --check-prefix=A
diff --git a/llvm/test/tools/llvm-ar/print.test b/llvm/test/tools/llvm-ar/print.test
index 997c05f225a8b..c104fb40818c2 100644
--- a/llvm/test/tools/llvm-ar/print.test
+++ b/llvm/test/tools/llvm-ar/print.test
@@ -1,12 +1,11 @@
## Test Print output
-# XFAIL: target={{.*}}-darwin{{.*}}
# RUN: rm -rf %t && mkdir -p %t
# RUN: echo file1 > %t/1.txt
# RUN: echo file2 > %t/2.txt
# RUN: echo file3 > %t/3.txt
-# RUN: llvm-ar -rc %t/archive.a %t/1.txt %t/2.txt %t/3.txt
+# RUN: llvm-ar -rc --format=gnu %t/archive.a %t/1.txt %t/2.txt %t/3.txt
## Print empty archive:
# RUN: llvm-ar --format=gnu cr %t/empty.a
More information about the llvm-commits
mailing list