-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
compiletest/codegen-llvm: automatically add needs-target-std if needed
#150672
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
base: main
Are you sure you want to change the base?
compiletest/codegen-llvm: automatically add needs-target-std if needed
#150672
Conversation
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
When running the codegen-llvm test suite, the "needs-target-std" directive is automatically added if and only if the "#![no_std]" line is not seen and the "needs-target-std" directive was not already seen. This is a best-effort utility to make running the codegen-llvm test suite for targets that do not support std slightly easier.
aab1410 to
0675c97
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.
The idea seems okay to me, I'll think about the impl a bit tho, because "injecting synthesized directive" feels a tad bit hacky
|
Reminder, once the PR becomes ready for a review, use |
When running the codegen-llvm test suite, the
needs-target-stddirective is automatically added if and only if the#![no_std]line is not seen and theneeds-target-stddirective was not already seen.This is a best-effort help to make running the codegen-llvm test suite for targets that do not support std slightly easier. Ideally, with time, the tests that aren't marked as no_std but in fact only use types from core/alloc will be patched to reflect this, so that they can be reused for targets without std.
For an explanation of this patch instead of a patch that marks all the tests that aren't
#![no_std]withneeds-target-std, see this Zulip thread. Let me know if, instead, a patch adding theneeds-target-stdis preferred.A simple test of the introduced behaviour is
./x test tests/codegen-llvm/align-fn.rs --target=riscv32e-unknown-none-elf --force-rerun -v. The test does not have theneeds-target-stddirective, but it is ignored with this message: