-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Make it possible to configure Swift test options with CMake #34407
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
Looks good to me! |
@swift-ci please smoke test |
Build failed |
Build failed |
CI failed due to a syntax error, could you fix that? |
@swift-ci please smoke test |
@@ -1,6 +1,6 @@ | |||
; REQUIRES: CODEGENERATOR=AArch64 | |||
; RUN: llvm-as %s -o %t.bc | |||
; RUN: %swift -target arm64-apple-tvos9 -c -module-name someModule -embed-bitcode -disable-llvm-optzns -o %t2.o %t.bc -dump-clang-diagnostics 2> %t.diags.txt | |||
; RUN: %swiftc_driver_plain -frontend -target arm64-apple-tvos9 -c -module-name someModule -embed-bitcode -disable-llvm-optzns -o %t2.o %t.bc -dump-clang-diagnostics 2> %t.diags.txt |
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.
%target-swift-frontend
can replace %swiftc_driver_plain -frontend
here. We'll take the last -target
on the command line anyways.
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 reason I went with %swiftc_driver_plain
is because that avoids the addition of swift_driver_test_options
or swift_frontend_test_options
. We are using these configs to specify import paths required for cross compiling, and if the paths get passed to this test it will fail with something like:
swift/test/Frontend/embed-bitcode-tvos.ll:16:23: error: CHECK-IMPORTER-NOT: excluded string found in input
; CHECK-IMPORTER-NOT: argument unused
^
<stdin>:2:10: note: found here
warning: argument unused during compilation: '-isystem /some/sysroot'
^~~~~~~~~~~~~~~
This matches the behavior of the embed-bitcode.ll
test.
@swift-ci please smoke test |
@swift-ci please smoke test |
Currently it is only possible to specify Swift driver and frontend test options via environment variables. This makes it unwieldy to run the tests when cross compiling or compiling for different sysroots. This PR makes it possible to add Swift driver and frontend flags as part of CMake configuration using the existing names provided in the environment.