Skip to content

Tests: Make some IRGen tests less deployment target dependent #71110

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

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

tshortli
Copy link
Contributor

Also, use %target-cpu lit substitution in IRGen/lto_autolink.swift.

Resolves rdar://121344608

@tshortli
Copy link
Contributor Author

swiftlang/llvm-project#8041

@swift-ci please smoke test

@tshortli tshortli merged commit 43afa11 into swiftlang:main Jan 25, 2024
@tshortli tshortli deleted the irgen-tests branch January 25, 2024 16:44
@kateinoigakukun
Copy link
Member

%target-cpu-unknown-linux-gnu and %target-cpu-apple-macosx10.15 can result in invalid triples like wasm32-apple-macosx. Unfortunately those invalid triples confuse LLVM: https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-20.04-webassembly/1907/console

I think it would be better to hardcode supported target triples instead of constructing from %target-cpu for this kind of target-specific test. Or we need to exclude invalid triple combinations. I guess you intended to add arm64 / aarch64 targets, right? If so, I will open a PR to update the test case.

@tshortli
Copy link
Contributor Author

Ok, these tests are failing when run on some platforms because not all bots produce x86_64 stdlibs and therefore the tests fail to find the Swift module. Also, hardcoding triples tends to make the tests run long because in some cases it forces the Swift module to be build for that architecture for the first time in the module cache. If we must hardcode the triples then we also need to limit the test to only running on very specific bots where those triples are known to work, and ideally the triple would be the "natural" triple for that bot. The target cpu substitution works well on macOS/iOS/etc to avoid the rebuild problem. Could you refactor this test to use REQUIREs to limit it to specific configurations?

@kateinoigakukun
Copy link
Member

Okay makes sense to me, thanks for your explanation 🙏 I'll refactor the test in that way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants