-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[test] llvm-ar: Adjust 2 tests to pass again after inadvertent unXFAIL for some target triples #159796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-binary-utilities Author: Anthony Latsis (AnthonyLatsis) ChangesThe history of these XFAILs is clouded. Initially added as target-based checks in Anyway, the problem with the current Full diff: https://github.com/llvm/llvm-project/pull/159796.diff 2 Files Affected:
diff --git a/llvm/test/tools/llvm-ar/extract.test b/llvm/test/tools/llvm-ar/extract.test
index bf46cc0743c7d..474dc8bb530ec 100644
--- a/llvm/test/tools/llvm-ar/extract.test
+++ b/llvm/test/tools/llvm-ar/extract.test
@@ -1,5 +1,6 @@
## Test extract operation.
# XFAIL: target={{.*}}-darwin{{.*}}
+# XFAIL: target={{.*}}-apple{{.*}}
# RUN: rm -rf %t && mkdir -p %t/extracted/
diff --git a/llvm/test/tools/llvm-ar/print.test b/llvm/test/tools/llvm-ar/print.test
index 997c05f225a8b..30169de9344fc 100644
--- a/llvm/test/tools/llvm-ar/print.test
+++ b/llvm/test/tools/llvm-ar/print.test
@@ -1,5 +1,6 @@
## Test Print output
# XFAIL: target={{.*}}-darwin{{.*}}
+# XFAIL: target={{.*}}-apple{{.*}}
# RUN: rm -rf %t && mkdir -p %t
# RUN: echo file1 > %t/1.txt
|
89bd8be
to
0e1ccba
Compare
Could you merge in changes from |
04f7207
to
8e34d65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but maybe an Apple developer would be better placed to confirm.
@alexander-shaposhnikov / @drodriguez / @RIscRIpt can any of you help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the tests are liberal in using --format=gnu
and it seems that the default format in macOS is probably darwin
which seems to add newlines at the end of the files (I don't know why).
I think adding a couple of --format=gnu
when creating the archives fixes the tests and should allow them to run on macOS no matter if you are targetting macOS or other platform, and no matter the triple spelling being used.
I imagine the reason is llvm-project/llvm/lib/Object/ArchiveWriter.cpp Lines 897 to 904 in ee8394d
To get the same behaviour with the default format in both I checked Xcode's |
…L for some target triples The problem with the current `target={{.*}}-darwin{{.*}}` XFAIL condition (changed in llvm#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.
8e34d65
to
a800d13
Compare
@drodriguez Thank you for helping out! I really appreciate the explanation. |
…L for some target triples (llvm#159796) The problem with the current `target={{.*}}-darwin{{.*}}` XFAIL condition (changed in llvm#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 (cherry picked from commit 33e82e6)
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:
llvm-project/llvm/lib/Object/ArchiveWriter.cpp
Lines 897 to 904 in ee8394d
Use
--format=gnu
to cope with the differences in the output and reenable the tests.rdar://157213658