rust/tests
Alex Crichton 88d7d20122 Skip cleanups on unsupported targets
This commit is an update to the `AbortUnwindingCalls` MIR pass in the
compiler. Specifically a new boolean is added for "can this target
possibly unwind" and if that's `false` then terminators are all adjusted
to be unreachable/not present. The end result is that this fixes 140293
for wasm targets.

The motivation for this PR is that currently on WebAssembly targets the
usage of the `C-unwind` ABI can lead LLVM to either (a) emit
exception-handling instructions or (b) hit a LLVM-ICE-style codegen
error. WebAssembly as a base instruction set does not support unwinding
at all, and a later proposal to WebAssembly, the exception-handling
proposal, was what enabled this. This means that the current intent of
WebAssembly targets is that they maintain the baseline of "don't emit
exception-handling instructions unless enabled". The commit here is
intended to restore this behavior by skipping these instructions even
when `C-unwind` is present.

Exception-handling is a relatively tricky and also murky topic in
WebAssembly, however. There are two sets of instructions LLVM can emit
for WebAssembly exceptions, Rust's Emscripten target supports
exceptions, WASI targets do not, the LLVM flags to enable this are not
always obvious, and additionally this all touches on "changing
exception-handling behavior should be a target-level concern, not a
feature". Effectively WebAssembly's exception-handling integration into
Rust is not finalized at this time. The best idea at this time is that a
parallel set of targets will eventually be added which support
exceptions, but it's not clear if/when to do this. In the meantime the
goal is to keep existing targets working while still enabling
experimentation with exception-handling with `-Zbuild-std` and various
permutations of LLVM flags.

To that extent this commit does not blanket disable these landing pads
and cleanup routines for WebAssembly but instead checks to see if
panic=unwind is enabled or if `+exception-handling` is enabled. Tests
are updated here as well to account for this where, by default, using a
`C-unwind` ABI won't affect Rust codegen at all. If
`+exception-handling` is enabled, however, then Rust codegen will look
like native platforms where exceptions are caught and the program aborts.
More-or-less I've done my best to keep exceptions working on wasm where
it's possible to have them work, but turned them off where they're not
supposed to be emitted.
2025-09-11 16:13:32 -07:00
..
assembly-llvm Auto merge of #145910 - saethlin:ignore-intrinsic-calls, r=cjgillot 2025-09-08 03:03:21 +00:00
auxiliary Add test for addrspacecasting global vars 2025-09-03 08:40:51 +02:00
codegen-llvm Skip cleanups on unsupported targets 2025-09-11 16:13:32 -07:00
codegen-units pub async fn implementation coroutine (func::{closure#0}) is monomorphized, when func itself is monomorphized 2025-09-01 13:45:00 +07:00
coverage Auto merge of #143290 - azhogin:azhogin/link-pub-async-impls, r=oli-obk 2025-09-01 10:54:40 +00:00
coverage-run-rustdoc
crashes Add compiler error when trying to use concat metavar expr in repetitions 2025-09-01 08:27:30 +02:00
debuginfo tests: Ignore basic-stepping.rs on riscv64 2025-08-29 08:11:48 +00:00
incremental Bless incremental tests. 2025-07-13 13:50:01 +00:00
mir-opt don't trim paths in mir dumping when filtering and at the top of the file 2025-09-09 16:23:14 -07:00
pretty Update autodiff tests for the new intrinsics impl 2025-08-14 18:33:43 +00:00
run-make Auto merge of #146233 - jieyouxu:run-make-fission, r=Kobzol 2025-09-06 18:37:35 +00:00
run-make-cargo tests: update test instruction in thumb-none-cortex-m 2025-09-05 21:22:51 +08:00
rustdoc Auto merge of #138736 - azhogin:azhogin/sanitizers-target-modificators, r=rcvalle 2025-09-04 22:51:33 +00:00
rustdoc-gui Ensure that --html-after-content option is used to check scrape_examples_ice rustdoc GUI test 2025-09-05 15:13:08 +02:00
rustdoc-js rustdoc: add tests for raw pointers in type-based search 2025-08-21 17:50:12 -05:00
rustdoc-js-std tests/rustdoc-js-std/parser-errors.js: remove syntax that is now valid 2025-08-21 20:50:33 -05:00
rustdoc-json Add tests for doc(attribute = "...") attribute 2025-08-28 15:56:30 +02:00
rustdoc-ui Add ui test for unsupported doc(attribute = "...") case for attributes with namespace 2025-08-28 18:24:58 +02:00
ui Rollup merge of #146428 - jieyouxu:revert-assert-desugaring, r=estebank,jackh726 2025-09-11 14:06:33 +10:00
ui-fulldeps Strip frontmatter in fewer places 2025-09-09 19:49:40 +02:00
COMPILER_TESTS.md