Commit graph

98 commits

Author SHA1 Message Date
Jubilee Young 26dccadb47 Allow "C-unwind" fn to have C variadics 2024-06-22 15:14:14 -07:00
Michael Goulet ffd72b1700 Fix remaining cases 2024-06-21 19:00:18 -04:00
Kjetil Kjeka 14348d9519 NVPTX: Avoid PassMode::Direct for C ABI 2024-05-31 22:45:27 +02:00
bors 23ea77b8ed Auto merge of #125702 - workingjubilee:tell-tidy-about-csky, r=nikic
Give tidy the good news about C-SKY

It seems this was overlooked in https://github.com/rust-lang/rust/pull/125472 because we don't test C-SKY much yet.

Fixes #125697

r? `@erikdesjardins`
2024-05-29 22:34:14 +00:00
Matthias Krüger d0311c1303
Rollup merge of #124655 - Darksonn:fixed-x18, r=lqd,estebank
Add `-Zfixed-x18`

This PR is a follow-up to #124323 that proposes a different implementation. Please read the description of that PR for motivation.

See the equivalent flag in [the clang docs](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-ffixed-x18).

MCP: https://github.com/rust-lang/compiler-team/issues/748
Fixes https://github.com/rust-lang/rust/issues/121970
r? rust-lang/compiler
2024-05-29 20:12:32 +02:00
Jubilee Young ce092d46e3 tests: reenable ABI compatibility test for csky 2024-05-29 10:35:16 -07:00
Alice Ryhl 4aafecb169 Simplify check for unsupported architectures 2024-05-29 16:58:46 +02:00
bors 4cf5723dbe Auto merge of #125695 - RalfJung:fn_arg_sanity_check, r=jieyouxu
fn_arg_sanity_check: fix panic message

The `\n` inside a raw string doesn't actually make a newline...
2024-05-29 09:49:23 +00:00
Ralf Jung 92af72d192 fn_arg_sanity_check: fix panic message
also update csky comment in abi/compatibility test
2024-05-29 08:16:47 +02:00
Mads Marquart 37ae2b68b1 Disable stack overflow handler tests on iOS-like platforms 2024-05-28 12:31:12 +02:00
Alice Ryhl 7677ff2879 Remove aarch64 from revisions list 2024-05-15 13:09:02 +02:00
Alice Ryhl 0ce51f59ec Remove fixed_x18.aarch64.stderr 2024-05-15 12:35:39 +02:00
Alice Ryhl b780fa9219 Use an error struct instead of a panic 2024-05-15 11:14:45 +02:00
Matthias Krüger 6e172c5fde
Rollup merge of #124096 - saethlin:rust-dbg-call, r=Nilstrieb
Clean up users of rust_dbg_call

`rust_dbg_call` is a C test helper that until this PR was declared in C with `void*` arguments and used in Rust _mostly_ with `libc::uintptr_t` arguments. Nearly every user just wants to pass integers around, so I've changed all users to `uint64_t` or `u64`.

The single test that actually used the pointer-ness of the argument is a test for ensuring that Rust can make extern calls outside of tasks. Rust hasn't had tasks for quite a few years now, so I'm deleting that test under the same logic as the test deleted in https://github.com/rust-lang/rust/pull/124073
2024-05-11 23:43:23 +02:00
beetrees 3769fddba2
Refactor float Primitives to a separate Float type 2024-05-06 14:56:10 +01:00
Markus Reiter 33e68aadc9
Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
bors 0e15f5ee8f Auto merge of #124072 - saethlin:less-sysroot-libc-misc, r=jieyouxu
Remove libc from more tests

The goal here is to trim down the number of tests that depend on libc from the sysroot to make https://github.com/rust-lang/rust/pull/123938 more plausible.

This PR is a few simple cases that I missed in https://github.com/rust-lang/rust/pull/123943.
2024-04-18 14:59:36 +00:00
Matthias Krüger 90013ff5ad
Rollup merge of #124090 - durin42:llvm-19-riscv-feature, r=cuviper
llvm: update riscv target feature to match LLVM 19

In llvm/llvm-project@9067070d91 they ended up largely reverting
llvm/llvm-project@e817966718. This means the change we did in
rust-lang/rust@b378059e6b is now only corrct for LLVM 18...so we have to adjust again.

``@rustbot`` label: +llvm-main
2024-04-18 08:37:49 +02:00
Augie Fackler 22b704bac4 llvm: update riscv target feature to match LLVM 19
In llvm/llvm-project@9067070d91 they ended
up largely reverting
llvm/llvm-project@e817966718. This means
the change we did in
rust-lang/rust@b378059e6b is now only
corrct for LLVM 18...so we have to adjust again.

@rustbot label: +llvm-main
2024-04-17 16:15:24 -04:00
Ben Kimock b91c1aafec Clean up users of rust_dbg_call 2024-04-17 15:08:08 -04:00
Ben Kimock 6298d8f8fa Remove libc from rust_get_test_int uses 2024-04-17 09:18:14 -04:00
Ben Kimock 1567d4d850 Remove libc from more tests 2024-04-17 08:36:49 -04:00
Ben Kimock 7457a0d441 Use the rustc_private libc less in tests 2024-04-15 08:54:11 -04:00
Erik Desjardins 4498cd6a8d extend extern tests to include FiveU16s
As described in the code, this extends just beyond a 64bit reg, but
isn't a round number, so it triggers some edge cases in the cast ABI.
2024-03-17 00:07:42 -04:00
bors 0fa7feaf3f Auto merge of #121282 - saethlin:gep-null-means-no-provenance, r=scottmcm
Lower transmutes from int to pointer type as gep on null

I thought of this while looking at https://github.com/rust-lang/rust/pull/121242. See that PR's description for why this lowering is preferable.

The UI test that's being changed here crashes without changing the transmutes into casts. Based on that, this PR should not be merged without a crater build-and-test run.
2024-03-12 04:11:37 +00:00
Ben Kimock 2eb9c6d49e Lower transmutes from int to pointer type as gep on null 2024-03-11 18:19:17 -04:00
Alex Crichton cf6d6050f7 Update test directives for wasm32-wasip1
* The WASI targets deal with the `main` symbol a bit differently than
  native so some `codegen` and `assembly` tests have been ignored.
* All `ignore-emscripten` directives have been updated to
  `ignore-wasm32` to be more clear that all wasm targets are ignored and
  it's not just Emscripten.
* Most `ignore-wasm32-bare` directives are now gone.
* Some ignore directives for wasm were switched to `needs-unwind`
  instead.
* Many `ignore-wasm32*` directives are removed as the tests work with
  WASI as opposed to `wasm32-unknown-unknown`.
2024-03-11 09:36:35 -07:00
bors aa029ce4d8 Auto merge of #122113 - matthiaskrgr:rollup-5d1jnwi, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #121958 (Fix redundant import errors for preload extern crate)
 - #121976 (Add an option to have an external download/bootstrap cache)
 - #122022 (loongarch: add frecipe and relax target feature)
 - #122026 (Do not try to format removed files)
 - #122027 (Uplift some feeding out of `associated_type_for_impl_trait_in_impl` and into queries)
 - #122063 (Make the lowering of `thir::ExprKind::If` easier to follow)
 - #122074 (Add missing PartialOrd trait implementation doc for array)
 - #122082 (remove outdated fixme comment)
 - #122091 (Note why we're using a new thread in `test_get_os_named_thread`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-07 02:30:40 +00:00
Alex Crichton 75fa9f6dec compiletest: Add a //@ needs-threads directive
This commit is extracted from #122036 and adds a new directive to the
`compiletest` test runner, `//@ needs-threads`. This is intended to
capture the need that a target must implement threading to execute a
specific test, typically one that uses `std::thread`. This is primarily
done for WebAssembly targets which currently do not have threads by
default. This enables transitioning a lot of `//@ ignore-wasm*`-style
ignores into a more self-documenting `//@ needs-threads` directive.
Additionally the `wasm32-wasi-preview1-threads` target, for example,
does actually have threads, but isn't tested in CI at this time. This
change enables running these tests for that target, but not other wasm
targets.
2024-03-06 12:35:07 -08:00
WANG Rui e81df3f322 loongarch: add frecipe and relax target feature 2024-03-06 17:24:32 +08:00
Ralf Jung f391c0793b only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
Alex Crichton cb39d6c515 Add a new wasm32-wasip1 target to rustc
This commit adds a new target called `wasm32-wasip1` to rustc.
This new target is explained in these two MCPs:

* https://github.com/rust-lang/compiler-team/issues/607
* https://github.com/rust-lang/compiler-team/issues/695

In short, the previous `wasm32-wasi` target is going to be renamed to
`wasm32-wasip1` to better live alongside the [new
`wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616).
This new target is added alongside the `wasm32-wasi` target and has the
exact same definition as the previous target. This PR is effectively a
rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that
as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi`
target is not being removed at this time. This change will reach stable
Rust before even a warning about the rename will be printed. At this
time this change is just the start where a new target is introduced and
users can start migrating if they support only Nightly for example.
2024-03-02 09:03:51 -08:00
Markus Reiter b2fbb8a053
Use generic NonZero in tests. 2024-02-25 12:03:48 +01:00
Obei Sideg 408eeae59d Improve wording of static_mut_ref
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-18 06:01:40 +03:00
许杰友 Jieyou Xu (Joe) ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Oli Scherer 5f6390f947 Continue compilation after check_mod_type_wf errors 2024-02-14 11:00:30 +00:00
clubby789 f6b21e90d1 Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
Obei Sideg a8aa6878f6 Update test for E0796 and static_mut_ref lint 2024-01-07 17:29:25 +03:00
bors e6d1b0ec98 Auto merge of #118491 - cuviper:aarch64-stack-probes, r=wesleywiser
Enable stack probes on aarch64 for LLVM 18

I tested this on `aarch64-unknown-linux-gnu` with LLVM main (~18).

cc #77071, to be closed once we upgrade our LLVM submodule.
2023-12-14 02:01:13 +00:00
bors e299752868 Auto merge of #118032 - RalfJung:char-u32, r=Mark-Simulacrum
guarantee that char and u32 are ABI-compatible

In https://github.com/rust-lang/rust/pull/116894 we added a guarantee that `char` has the same alignment as `u32`, but there is still one axis where these types could differ: function call ABI. So let's nail that down as well: in a function signature, `char` and `u32` are completely equivalent.

This is a new stable guarantee, so it will need t-lang approval.
2023-12-11 04:13:19 +00:00
Krasimir Georgiev b378059e6b update target feature following LLVM API change
LLVM commit e817966718
renamed the `unaligned-scalar-mem` target feature to `fast-unaligned-access`.
2023-12-08 13:06:07 +00:00
Josh Stone b99b5e5752 Enable stack probes on aarch64 for LLVM 18 2023-12-07 17:17:00 -08:00
bors 16087eeea8 Auto merge of #118127 - RalfJung:unadjusted-abi, r=compiler-errors
the unadjusted ABI needs to pass aggregates by-value

Fixes https://github.com/rust-lang/rust/issues/118124, a regression introduced in https://github.com/rust-lang/rust/pull/117500
2023-11-25 17:06:22 +00: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
Ralf Jung ebfb95a357 add a test 2023-11-22 07:24:40 +01:00
bors d19980e1ce Auto merge of #117500 - RalfJung:aggregate-abi, r=davidtwco
Ensure sanity of all computed ABIs

This moves the ABI sanity assertions from the codegen backend to the ABI computation logic. Sadly, due to past mistakes, we [have to](https://github.com/rust-lang/rust/pull/117351#issuecomment-1788495503) be able to compute a sane ABI for nonsensical function types like `extern "C" fn(str) -> str`.  So to make the sanity check pass we first need to make all ABI adjustment deal with unsized types... and we have no shared infrastructure for those adjustments, so that's a bunch of copy-paste. At least we have assertions failing loudly when one accidentally sets a different mode for an unsized argument.

To achieve this, this re-lands the parts of https://github.com/rust-lang/rust/pull/80594 that got reverted in https://github.com/rust-lang/rust/pull/81388.  To avoid breaking wasm ABI again, that ABI now explicitly opts-in to the (wrong, broken) ABI that we currently keep for backwards compatibility. That's still better than having *every* ABI use the wrong broken default!

Cc `@bjorn3`
Fixes https://github.com/rust-lang/rust/issues/115845
2023-11-19 18:42:20 +00:00
Ralf Jung cfb47ca5df disable csky test on CI 2023-11-19 15:01:33 +01:00
Ralf Jung b4f3f2aeac guarantee that char and u32 are ABI-compatible 2023-11-18 08:24:02 +01:00
Matthias Krüger ca3a02836e
Rollup merge of #117338 - workingjubilee:asmjs-meets-thanatos, r=b-naber
Remove asmjs

Fulfills [MCP 668](https://github.com/rust-lang/compiler-team/issues/668).

`asmjs-unknown-emscripten` does not work as-specified, and lacks essential upstream support for generating asm.js, so it should not exist at all.
2023-11-17 23:04:21 +01:00
Ralf Jung 0865a2ec78 test and fix some more targets 2023-11-07 17:21:02 +01:00