Skip to content

Commit 33e82e6

Browse files
[test] llvm-ar: Adjust 2 tests to pass again after inadvertent unXFAIL for some target triples (#159796)
The problem with the current `target={{.*}}-darwin{{.*}}` XFAIL condition (changed in #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. rdar://157213658
1 parent 699f085 commit 33e82e6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/test/tools/llvm-ar/extract.test

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## Test extract operation.
2-
# XFAIL: target={{.*}}-darwin{{.*}}
32

43
# RUN: rm -rf %t && mkdir -p %t/extracted/
54

@@ -9,7 +8,7 @@
98

109
# RUN: echo filea > %t/a.txt
1110
# RUN: echo fileb > %t/b.txt
12-
# RUN: llvm-ar rc %t/archive.a %t/a.txt %t/b.txt
11+
# RUN: llvm-ar rc --format=gnu %t/archive.a %t/a.txt %t/b.txt
1312

1413
## Single member:
1514
# RUN: cd %t/extracted && llvm-ar xv %t/archive.a a.txt | FileCheck %s --check-prefix=A

llvm/test/tools/llvm-ar/print.test

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
## Test Print output
2-
# XFAIL: target={{.*}}-darwin{{.*}}
32

43
# RUN: rm -rf %t && mkdir -p %t
54
# RUN: echo file1 > %t/1.txt
65
# RUN: echo file2 > %t/2.txt
76
# RUN: echo file3 > %t/3.txt
87

9-
# RUN: llvm-ar -rc %t/archive.a %t/1.txt %t/2.txt %t/3.txt
8+
# RUN: llvm-ar -rc --format=gnu %t/archive.a %t/1.txt %t/2.txt %t/3.txt
109

1110
## Print empty archive:
1211
# RUN: llvm-ar --format=gnu cr %t/empty.a

0 commit comments

Comments
 (0)