Commit Graph

43 Commits

Author SHA1 Message Date
Guillaume Gomez a8051a6ca3 Ignore more failing ui tests for GCC backend 2025-10-13 15:30:26 +02:00
Guillaume Gomez a535c7be54 Ignore more failing ui tests for GCC backend 2025-09-26 15:33:48 +02:00
Reuben Cruise 06819d95c0 Extends branch protection tests to include GCS 2025-09-22 11:29:54 +01:00
Noratrieb f157ce994e Add --print target-spec-json-schema
This schema is helpful for people writing custom target spec JSON. It
can provide autocomplete in the editor, and also serves as documentation
when there are documentation comments on the structs, as `schemars` will
put them in the schema.
2025-09-12 20:53:28 +02:00
Jana Dönszelmann 59ceb02d65 Port crate name to the new attribute system 2025-08-24 09:20:57 +02:00
Miguel Ojeda 1a29d9c23f Add -Zindirect-branch-cs-prefix option
This is intended to be used for Linux kernel RETPOLINE builds.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-08-17 16:51:42 +02:00
Esteban Küber 625143bac3 Add link to docs on malformed attributes 2025-08-11 16:00:49 +00:00
David Wood 322cc31504 tests: {Meta,Pointee}Sized in non-minicore tests
As before, add `MetaSized` and `PointeeSized` traits to all of the
non-minicore `no_core` tests so that they don't fail for lack of
language items.
2025-06-16 23:04:33 +00:00
Vadim Petrochenkov 56d6b4e427 compiletest: Support matching on non-json lines in compiler output
and migrate most of remaining `error-pattern`s to it.
2025-05-04 18:27:45 +03:00
xizheyin d054690049 Unify the format of rustc cli flags
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-24 12:54:40 +08:00
xizheyin 6fe881c788 Construct OutputType using macro and print [=FILENAME] help info
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-21 18:07:58 +08:00
xizheyin 4c20d17365 Add ui test emit-output-types-without-args.rs
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-20 19:49:48 +08:00
clubby789 1b46969a11 Specify --print info=file syntax in --help 2025-04-14 14:52:27 +01:00
Jieyou Xu c615d10743 tests: use specific-purpose needs-crate-type over ignore-$target directives
Not all existing tests are converted, I only updated ones that I can
easily find via directive comments.
2025-04-10 12:52:08 +08:00
Vadim Petrochenkov 4d64990690 compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
Takayuki Maeda eb23a597c8 Rollup merge of #139184 - Urgau:crate-root-lint-levels, r=jieyouxu
Add unstable `--print=crate-root-lint-levels`

This PR implements `--print=crate-root-lint-levels` from MCP 833 https://github.com/rust-lang/compiler-team/issues/833.

Tracking issue: https://github.com/rust-lang/rust/issues/139180

Best reviewed commit by commit.
2025-04-02 22:52:45 +09:00
Urgau df18de57a5 Add unstable --print=crate-root-lint-levels 2025-04-01 18:29:39 +02:00
Vadim Petrochenkov 8d5109aa6e compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
Jieyou Xu f1b8d89659 Rebless tests with changed help due to new print request option 2025-03-23 19:08:55 +08:00
xizheyin 5a52b5d92a Suggest -Whelp when pass --print lints to rustc
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-19 18:48:00 +08:00
malezjaa 90bf2b159a Show valid crate types when the user passes unknown --crate-type value
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2025-03-14 15:53:42 +08:00
Michael Toner 6f505ba767 ensure we always print all --print options in help 2025-03-01 12:05:51 -06:00
León Orell Valerian Liehr 9b6fd35738 Reject macro calls inside of #![crate_name] 2025-02-15 16:47:30 +01:00
León Orell Valerian Liehr 46d53a68aa Move #![crate_type] UI tests into attributes directory
Gets rid of two top-level UI tests which is always great.

Furthermore, move `need-crate-arg-ignore-tidy$x.rs`
from `command/` to `invalid-compile-flags/`.
`command/` concerns `std::process::Command` tests, not CLI tests.
2025-02-15 03:41:07 +01:00
Tshepang Mbambo d5f645647f clarify
Also, use signular form for consistency/simplicity
2025-02-12 04:41:14 +02:00
Tshepang Mbambo 3e50873aa1 test cli functionality in all targets 2025-02-12 04:38:03 +02:00
Erick Tryzelaar 49942961a7 Only test proc-macro invalid compile flags with panic=unwind
Fuchsia explicitly builds rust and all rust targets with `-C
panic=abort` to minimize code generation size. However, when compiling a
proc-macro with this setting it can cause a warning to be emitted, which
breaks `tests/ui/invalid-compile-flags/crate-type-flag.rs`. This hasn't
been a problem in the past for us since we compile our proc macros on
host, rather than inside Fuchsia.

This attempts to fix the issue by explicitly requiring that we're using
the unwinder when compiling this test to avoid the warning being
emitted.

Fixes #135223
2025-01-08 18:00:26 +00:00
许杰友 Jieyou Xu (Joe) 92e8e84e7d tests: add basic test coverage for cli flag --crate-type 2024-12-30 19:10:43 +08:00
Andrew Zhogin 9aab517d63 rust_for_linux: -Zreg-struct-return commandline flag for X86 (#116973) 2024-12-02 01:14:40 +07:00
Camille GILLOT 982cde9801 Remove extra tests. 2024-11-26 10:46:02 +00:00
Matthias Krüger c8247c0a19 Rollup merge of #132259 - mrkajetanp:branch-protection-pauth-lr, r=davidtwco
rustc_codegen_llvm: Add a new 'pc' option to branch-protection

Add a new 'pc' option to -Z branch-protection for aarch64 that enables the use of PC as a diversifier in PAC branch protection code.

When the pauth-lr target feature is enabled in combination with -Z branch-protection=pac-ret,pc, the new 9.5-a instructions (pacibsppc, retaasppc, etc) will be generated.
2024-11-05 20:10:49 +01:00
Noratrieb ba481518da Add --print host-triple
People often parse `-vV` output to get to the host triple, which is
annoying to do. It's easier to just get it directly.
2024-11-02 21:29:59 +01:00
Kajetan Puchalski 10edeea4b4 rustc_codegen_llvm: Add a new 'pc' option to branch-protection
Add a new 'pc' option to -Z branch-protection for aarch64 that
enables the use of PC as a diversifier in PAC branch protection code.

When the pauth-lr target feature is enabled in combination
with -Z branch-protection=pac-ret,pc, the new 9.5-a instructions
(pacibsppc, retaasppc, etc) will be generated.
2024-10-31 11:59:17 +00:00
Andrew Zhogin b3ae64d24f rust_for_linux: -Zregparm=<N> commandline flag for X86 (#116972) 2024-10-18 00:29:31 +07:00
George Bateman 6360287fd9 Fix #128930: Print documentation of CLI options missing their arg 2024-08-11 09:10:30 +01:00
Urgau ac59bdc20c Add --print=check-cfg to get the expected configs 2024-04-25 07:58:31 +02:00
Urgau 153b1f0421 Improve diagnostic for unknown --print request 2024-04-24 15:52:01 +02:00
许杰友 Jieyou Xu (Joe) ec2cc761bc [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Tomasz Miąsko 1a47e413b2 Fuel is incompatible with incremental compilation 2023-12-08 00:00:00 +00:00
Miguel Ojeda 2d476222e8 Add -Zfunction-return={keep,thunk-extern} option
This is intended to be used for Linux kernel RETHUNK builds.

With this commit (optionally backported to Rust 1.73.0), plus a
patched Linux kernel to pass the flag, I get a RETHUNK build with
Rust enabled that is `objtool`-warning-free and is able to boot in
QEMU and load a sample Rust kernel module.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-11-30 20:21:31 +01:00
Nilstrieb 41e8d152dc Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Miguel Ojeda 35f03b763e Move invalid-llvm-passes test to invalid-compile-flags folder
Nowadays there is an `invalid-compile-flags` folder, thus move this
one there.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-10-20 14:59:26 +02:00
Albert Larsan cf2dff2b1e Move /src/test to /tests 2023-01-11 09:32:08 +00:00