Skip to content

organize and extend forbidden target feature tests #140395

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RalfJung
Copy link
Member

In particular this adds some loongarch tests for #135015, Cc @heiher

Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.

@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 28, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r=me with tidy fixed.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@RalfJung RalfJung force-pushed the target-feature-tests branch from 1b9008f to 240cc10 Compare April 28, 2025 14:09
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#18 exporting to docker image format
#18 sending tarball 19.6s done
#18 DONE 27.6s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--set', 'gcc.download-ci-gcc=true', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
---- [ui] tests/ui/target-feature/abi-required-target-feature-flag-disable.rs#loongarch stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/target-feature/abi-required-target-feature-flag-disable.loongarch/abi-required-target-feature-flag-disable.loongarch.stderr"
diff of stderr:

+ '+div32' is not a recognized feature for this target (ignoring feature)
+ '+div32' is not a recognized feature for this target (ignoring feature)
+ '+lam-bh' is not a recognized feature for this target (ignoring feature)
+ '+lam-bh' is not a recognized feature for this target (ignoring feature)
+ '+lamcas' is not a recognized feature for this target (ignoring feature)
+ '+lamcas' is not a recognized feature for this target (ignoring feature)
+ '+ld-seq-sa' is not a recognized feature for this target (ignoring feature)
+ '+ld-seq-sa' is not a recognized feature for this target (ignoring feature)
+ '+scq' is not a recognized feature for this target (ignoring feature)
+ '+scq' is not a recognized feature for this target (ignoring feature)
1 warning: target feature `d` must be enabled to ensure that the ABI of the current target can be implemented correctly
2    |
3    = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!


The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args target-feature/abi-required-target-feature-flag-disable.rs`

error in revision `loongarch`: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--cfg" "loongarch" "--check-cfg" "cfg(test,FALSE,x86,x86_implied,aarch64,riscv,loongarch)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/target-feature/abi-required-target-feature-flag-disable.loongarch" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--crate-type=lib" "--target=loongarch64-unknown-none" "-Ctarget-feature=-d"
stdout: none
--- stderr -------------------------------
'+div32' is not a recognized feature for this target (ignoring feature)
'+div32' is not a recognized feature for this target (ignoring feature)
'+lam-bh' is not a recognized feature for this target (ignoring feature)
'+lam-bh' is not a recognized feature for this target (ignoring feature)
'+lamcas' is not a recognized feature for this target (ignoring feature)
'+lamcas' is not a recognized feature for this target (ignoring feature)
'+ld-seq-sa' is not a recognized feature for this target (ignoring feature)
'+ld-seq-sa' is not a recognized feature for this target (ignoring feature)
'+scq' is not a recognized feature for this target (ignoring feature)
'+scq' is not a recognized feature for this target (ignoring feature)
warning: target feature `d` must be enabled to ensure that the ABI of the current target can be implemented correctly
   |
   = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>

warning: unstable feature specified for `-Ctarget-feature`: `d`
   |
   = note: this feature is not stably supported; its behavior can change in the future

warning: both target-abi and the triple-implied ABI are invalid, ignoring and using feature-implied ABI
warning: 'lp64f' has not been standardized
warning: 2 warnings emitted
------------------------------------------



|
= note: this feature is not stably supported; its behavior can change in the future

warning: both target-abi and the triple-implied ABI are invalid, ignoring and using feature-implied ABI
Copy link
Member Author

@RalfJung RalfJung Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heiher any idea what this warning is about? Does it come from LLVM?

For riscv it says

Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi)

which is a lot more clear. Is this trying to say the same thing?

@RalfJung
Copy link
Member Author

RalfJung commented Apr 28, 2025

So somehow on CI we get a bunch of extra warnings:

2025-04-28T14:35:22.9208959Z '+div32' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9209370Z '+div32' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9209778Z '+lam-bh' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9210178Z '+lam-bh' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9210688Z '+lamcas' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9211099Z '+lamcas' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9211515Z '+ld-seq-sa' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9211932Z '+ld-seq-sa' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9212335Z '+scq' is not a recognized feature for this target (ignoring feature)
2025-04-28T14:35:22.9212721Z '+scq' is not a recognized feature for this target (ignoring feature)

I don't get those when running the test locally. Is that an LLVM version thing? Does loongarch64-unknown-none not work on older LLVM versions (not without a bunch of warnings, anyway)? How would one write a test for that target then...? And what even enables those target features?!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants