-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Remove needs-asm-support directive in tests with explicit targets #147406
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: master
Are you sure you want to change the base?
Remove needs-asm-support directive in tests with explicit targets #147406
Conversation
e8663b2
to
d2aaa62
Compare
The `needs-asm-support` directive checks whether the host architecture supports inline assembly, not the target architecture. For tests that explicitly specify a target via `--target` in their compile-flags, this directive is incorrect and unnecessary. These tests are cross-compiling to specific targets (like x86_64, arm, aarch64, riscv, etc.) that are already known to have stable asm support. The directive was causing these tests to be incorrectly skipped on hosts that don't support asm, even though the target does. Tests with explicit targets should rely on `needs-llvm-components` to ensure the appropriate backend is available, rather than checking host asm support.
d2aaa62
to
3217497
Compare
Maybe instead of |
I agree with bjorn re: the design. These directives likely hung around because they were non-cross tests before. |
Thanks @bjorn3 and @workingjubilee for the feedback! I appreciate you both thinking about this. Let me explain my thinking on this change, and I'd appreciate your feedback on whether I'm understanding this correctly. My understanding of the issue: From what I can tell, the existing For these cross-compilation tests (which use
This is, in fact, what is happens on Fedora ppc64le builds. Why I went with just removing the directive: Since these tests already use I also updated the documentation for Regarding the I can see how such directive could provide a more robust long-term solution, especially if there are other directives with similar host-vs-target confusion (like the I have to admit I'm not familiar enough with the compiletest infrastructure internals to do this confidently. I also don't have a lot of bandwidth right now for a larger refactoring. That said, if you both think this is an important improvement and something that would be reasonable for a less experienced contributor to tackle, I'd be willing to give it a try with some guidance. Could you share your thoughts on:
Alternatively, if this feels like it needs someone with deeper knowledge of the testing infrastructure, I completely understand - maybe this simpler fix could land as-is to address the immediate problem, and someone more experienced could implement the better long-term solution? I'm open to either path and appreciate your guidance! |
I think there are some things that a target directive could improve, but directive or not, needs-asm-support is redundant in my view. For the in-tree compiler, the asm-support status of a given arch will always be the same, and presumably it is supported if someone bothered to write a specific target test (or else the test is not useful). A target directive would be great to avoid manual |
I'm not super familiar with this area, but I'm inclined to land this, even if there is a better solution. Adding a @bjorn3 and @workingjubilee any concerns on merging this pending a better long-term solution? |
☔ The latest upstream changes (presumably #146414) made this pull request unmergeable. Please resolve the merge conflicts. |
The
needs-asm-support
directive checks whether the host architecture supports inline assembly, not the target architecture. For tests that explicitly specify a target via--target
in their compile-flags, this directive is incorrect and unnecessary.These tests are cross-compiling to specific targets (like x86_64, arm, aarch64, riscv, etc.) that are already known to have stable asm support. The directive was causing these tests to be incorrectly skipped on hosts that don't support asm, even though the target does.
Tests with explicit targets should rely on
needs-llvm-components
to ensure the appropriate backend is available, rather than checking host asm support.