rust/tests/codegen
Jubilee 8c9e3749a1
Rollup merge of #136985 - zachs18:backend-repr-remove-uninhabited, r=workingjubilee
Do not ignore uninhabited types for function-call ABI purposes. (Remove BackendRepr::Uninhabited)

Accepted MCP: https://github.com/rust-lang/compiler-team/issues/832

Fixes #135802

Do not consider the inhabitedness of a type for function call ABI purposes.

* Remove the [`rustc_abi::BackendRepr::Uninhabited`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/enum.BackendRepr.html) variant
  * Instead calculate the `BackendRepr` of uninhabited types "normally" (as though they were not uninhabited "at the top level", but still considering inhabitedness of variants to determine enum layout, etc)
* Add an `uninhabited: bool` field to [`rustc_abi::LayoutData`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/struct.LayoutData.html) so inhabitedness of a `LayoutData` can still be queried when necessary (e.g. when determining if an enum variant needs a tag value allocated to it).

This should not affect type layouts (size/align/field offset); this should only affect function call ABI, and only of uninhabited types.

cc ``@RalfJung``
2025-02-20 14:58:18 -08:00
..
asm Create a generic AVR target: avr-none 2025-02-19 19:01:51 +01:00
auxiliary Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
avr Create a generic AVR target: avr-none 2025-02-19 19:01:51 +01:00
bounds-checking Simplify the GEP instruction for index 2024-12-15 19:01:45 +08:00
cffi more `asm!` -> `naked_asm!` in tests 2024-10-06 18:12:25 +02:00
compiletest-self-test tests/codegen: add `minicore` compiletest self-test 2024-10-31 18:20:11 +08:00
cross-crate-inlining tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
debug-accessibility Explicitly register `MSVC`/`NONMSVC` revisions for some codegen tests 2024-12-19 20:36:51 +08:00
debuginfo-proc-macro Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
dllimports Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
enum Rollup merge of #136895 - maurer:fix-enum-discr, r=nikic 2025-02-13 17:46:08 -08:00
float x86-sse2 ABI: use SSE registers for floats and SIMD 2025-02-18 16:11:41 +01:00
hint tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
instrument-coverage coverage: Adjust a codegen test to ignore the order of covmap/covfun globals 2024-12-11 21:34:48 +11:00
instrument-xray [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
intrinsics Emit `trunc nuw` for unchecked shifts and `to_immediate_scalar` 2025-02-19 11:36:52 -08:00
issues x86-sse2 ABI: use SSE registers for floats and SIMD 2025-02-18 16:11:41 +01:00
lib-optimizations tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
loongarch-abi tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
macos tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
meta-filecheck compiletest: don't register `MSVC`/`NONMSVC` FileCheck prefixes 2024-12-19 20:36:51 +08:00
naked-fn tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
non-terminate Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
patchable-function-entry Updated code for changes to RFC, added additional error handling, added 2024-06-25 19:00:02 +02:00
remap_path_prefix [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
repr tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
riscv-abi tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
sanitizer Rollup merge of #127483 - BertalanD:no_sanitize-global-var, r=rcvalle 2024-11-23 20:19:51 +08:00
simd Rework `OperandRef::extract_field` to stop calling `to_immediate_scalar` on things which are already immediates 2025-02-19 12:03:40 -08:00
simd-intrinsic x86-sse2 ABI: use SSE registers for floats and SIMD 2025-02-18 16:11:41 +01:00
src-hash-algorithm [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
unwind-abis Remove c_unwind from tests and fix tests 2024-06-19 13:54:55 +01:00
README.md
aarch64-softfloat.rs Update test expectations to accept LLVM 'initializes' attribute 2024-11-25 15:30:35 +01:00
aarch64-struct-align-128.rs Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
abi-efiapi.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
abi-main-signature-16bit-c-int.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
abi-main-signature-32bit-c-int.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
abi-repr-ext.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
abi-sysv64.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
abi-win64-zst.rs use add-core-stubs / minicore for a few more tests 2025-02-16 18:37:50 +01:00
abi-x86-interrupt.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
abi-x86-sse.rs x86-sse2 ABI: use SSE registers for floats and SIMD 2025-02-18 16:11:41 +01:00
abi-x86_64_sysv.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
addr-of-mutate.rs LLVM changed the nocapture attribute to captures(none) 2025-01-30 11:22:46 +01:00
adjustments.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
align-byval-alignment-mismatch.rs use add-core-stubs / minicore for a few more tests 2025-02-16 18:37:50 +01:00
align-byval-vector.rs use add-core-stubs / minicore for a few more tests 2025-02-16 18:37:50 +01:00
align-byval.rs use add-core-stubs / minicore for a few more tests 2025-02-16 18:37:50 +01:00
align-enum.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
align-fn.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
align-offset.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
align-struct.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
alloc-optimisation.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
amdgpu-addrspacecast.rs Cast allocas to default address space 2025-02-10 21:38:44 +01:00
array-clone.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
array-cmp.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
array-codegen.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
array-equality.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
array-from_fn.rs test(std): Add codegen test for array::from_fn optimization 2024-08-10 10:44:24 +08:00
array-map.rs use [N x i8] for alloca types 2024-04-11 21:42:35 -04:00
array-optimized.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
array-repeat.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
ascii-char.rs codegen tests: Tolerate `nuw` `nsw` on `trunc` 2024-04-11 17:20:08 +00:00
async-closure-debug.rs Stabilize async closures 2024-12-13 00:04:56 +00:00
async-fn-debug-awaitee-field.rs Explicitly register `MSVC`/`NONMSVC` revisions for some codegen tests 2024-12-19 20:36:51 +08:00
async-fn-debug-msvc.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
async-fn-debug.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
atomic-operations.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
atomicptr.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
autodiff.rs move second opt run to lto phase and cleanup code 2025-02-10 01:35:22 -05:00
autovectorize-f32x4.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
bigint-helpers.rs Override `disjoint_or` in the LLVM backend 2025-01-31 22:29:08 -08:00
binary-heap-peek-mut-pop-no-panic.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
binary-search-index-no-bound-check.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
bool-cmp.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
box-uninit-bytes.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
bpf-alu32.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
branch-protection-old-llvm.rs tests: use `max-llvm-major-version` instead of `ignore-llvm-version` range like `N - 99` 2024-11-14 17:44:54 +08:00
branch-protection.rs rustc_codegen_llvm: Add a new 'pc' option to branch-protection 2024-10-31 11:59:17 +00:00
call-llvm-intrinsics.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
call-metadata.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
cast-optimized.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
cast-target-abi.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
catch-unwind.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
cdylib-external-inline-fns.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
cf-protection.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
cfguard-checks.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
cfguard-disabled.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
cfguard-nochecks.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
cfguard-non-msvc.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
char-ascii-branchless.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
checked_ilog.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
checked_math.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
clone-shims.rs Let InstCombine remove Clone shims inside Clone shims 2024-07-25 15:14:42 -04:00
clone_as_copy.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
codemodels.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
coercions.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
cold-call-declare-and-call.rs Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
common_prim_int_ptr.rs llvm: Tolerate captures in tests 2025-02-14 18:55:50 +00:00
comparison-operators-2-tuple.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
comparison-operators-newtype.rs Set `signext` or `zeroext` for integer arguments on RISC-V 2024-10-23 04:42:03 +02:00
const-array.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
const-vector.rs Ban non-array SIMD 2024-09-09 19:39:43 -07:00
const_scalar_pair.rs Fix tests and bless 2024-04-24 13:12:33 +01:00
constant-branch.rs Compute reachable locals as part of non_ssa_locals 2024-09-21 01:07:00 -04:00
consts.rs Use FileCheck to parameterize codegen tests over hashes 2024-06-04 01:30:51 -07:00
coroutine-debug-msvc.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
coroutine-debug.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
dealloc-no-unwind.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
debug-alignment.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
debug-column-msvc.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
debug-column.rs Enable more tests on Windows 2025-02-03 10:39:32 -05:00
debug-compile-unit-path.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
debug-fndef-size.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
debug-limited.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
debug-line-directives-only.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
debug-line-tables-only.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
debug-linkage-name.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
debug-vtable.rs Explicitly register `MSVC`/`NONMSVC` revisions for some codegen tests 2024-12-19 20:36:51 +08:00
debuginfo-constant-locals.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
debuginfo-generic-closure-env-names.rs Explicitly register `MSVC`/`NONMSVC` revisions for some codegen tests 2024-12-19 20:36:51 +08:00
debuginfo-inline-callsite-location.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
deduced-param-attrs.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
default-requires-uwtable.rs Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
default-visibility.rs Use Default visibility for rustc-generated C symbol declarations 2024-10-11 08:43:27 +11:00
direct-access-external-data.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
dont-shuffle-bswaps.rs tests: simplify dont-shuffle-bswaps test 2025-02-11 13:41:26 -08:00
dont_codegen_private_const_fn_only_used_in_const_eval.rs Also support generic constants 2024-06-05 15:40:11 +00:00
drop-in-place-noalias.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
drop.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
dst-offset.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
dst-vtable-align-nonzero.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
dst-vtable-size-range.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
ehcontguard_disabled.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
ehcontguard_enabled.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
emscripten-catch-unwind-js-eh.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
emscripten-catch-unwind-wasm-eh.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
enable-lto-unit-splitting.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
error-provide.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
export-no-mangle.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
external-no-mangle-fns.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
external-no-mangle-statics.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
f128-wasm32-callconv.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
fastcall-inreg.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
fatptr.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
fewer-names.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
fixed-x18.rs Add -Zfixed-x18 2024-05-03 14:32:08 +02:00
float_math.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
fn-impl-trait-self.rs Update test directives for `wasm32-wasip1` 2024-03-11 09:36:35 -07:00
force-frame-pointers.rs test: ignore force-frame-pointers test on some targets 2024-06-23 00:40:43 -07:00
force-no-unwind-tables.rs Enable more tests on Windows 2025-02-03 10:39:32 -05:00
force-unwind-tables.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
frame-pointer.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
function-arguments-noopt.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
function-arguments.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
function-return.rs Add missing module flags for function-return=thunk-extern 2024-09-25 15:53:53 +02:00
gdb_debug_script_load.rs remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
generic-debug.rs reenable some windows tests 2024-07-14 13:48:29 +03:00
gep-index.rs Simplify the GEP instruction for index 2024-12-15 19:01:45 +08:00
gpu-kernel-abi.rs Add gpu-kernel calling convention 2025-01-16 00:26:55 +01:00
i128-wasm32-callconv.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
i128-x86-align.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
i128-x86-callconv.rs x86_win64 ABI: do not use xmm0 with softfloat ABI 2025-02-19 08:41:19 +01:00
infallible-unwrap-in-opt-z.rs Ignore less tests in debug builds 2024-02-23 18:04:01 -05:00
inherit_overflow.rs Codegen const panic messages as function calls 2024-03-22 09:55:50 -04:00
inline-always-works-always.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
inline-debuginfo.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
inline-function-args-debug-info.rs Rework MIR inlining debuginfo so function parameters show up in debuggers. 2024-08-12 19:20:00 -07:00
inline-hint.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
instrument-mcount.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
integer-cmp.rs tests: use `max-llvm-major-version` instead of `ignore-llvm-version` range like `N - 99` 2024-11-14 17:44:54 +08:00
integer-overflow.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
internalize-closures.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
intrinsic-no-unnamed-attr.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
is_val_statically_known.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
issue-97217.rs Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
iter-repeat-n-trivial-drop.rs llvm: Tolerate propagated range metadata 2024-10-16 18:38:26 +00:00
layout-size-checks.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
lifetime_start_end.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
link-dead-code.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
link_section.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
llvm-ident.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
llvm_module_flags.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
loads.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
local-generics-in-exe-internalized.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
lto-removes-invokes.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
mainsubprogram.rs reenable some windows tests 2024-07-14 13:48:29 +03:00
match-optimized.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
match-optimizes-away.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
match-unoptimized.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
maybeuninit-rvo.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
mem-replace-big-type.rs We don't need `NonNull::as_ptr` debuginfo 2024-12-10 01:29:43 -08:00
mem-replace-simple-type.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
merge-functions.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
method-declaration.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
min-function-alignment.rs add `-Zmin-function-alignment` 2025-01-10 22:53:54 +01:00
mir-aggregate-no-alloca.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
mir-inlined-line-numbers.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
mir_zst_stores.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
move-before-nocapture-ref-arg.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
move-operands.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
naked-asan.rs fix the `naked-asan` test 2024-12-10 21:41:05 +01:00
no-alloca-inside-if-false.rs Compute reachable locals as part of non_ssa_locals 2024-09-21 01:07:00 -04:00
no-assumes-on-casts.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
no-dllimport-w-cross-lang-lto.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
no-jump-tables.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
no-plt.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
no-redundant-item-monomorphization.rs Port issue-7349 to a codegen test 2024-04-04 21:59:08 +01:00
no_builtins-at-crate.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
noalias-box-off.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
noalias-box.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
noalias-flag.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
noalias-freeze.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
noalias-refcell.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
noalias-rwlockreadguard.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
noalias-unpin.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
noreturn-uninhabited.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
noreturnflag.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
nounwind.rs reenable some windows tests 2024-07-14 13:48:29 +03:00
nrvo.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
optimize-attr-1.rs Implement `optimize(none)` attribute 2025-01-23 17:19:53 +00:00
option-as-slice.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
option-niche-eq.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
overaligned-constant.rs Also generate undef scalars and scalar pairs 2025-01-21 08:22:15 +00:00
packed.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
panic-abort-windows.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
panic-in-drop-abort.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
panic-unwind-default-uwtable.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
pattern_type_symbols.rs Rename `core_pattern_type` and `core_pattern_types` lib feature gates to `pattern_type_macro` 2024-12-04 16:16:24 +00:00
personality_lifetimes.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
pgo-counter-bias.rs Use `-Zno-profiler-runtime` instead of `//@ needs-profiler-support` 2024-06-14 13:31:46 +10:00
pgo-instrumentation.rs Use `-Zno-profiler-runtime` instead of `//@ needs-profiler-support` 2024-06-14 13:31:46 +10:00
pic-relocation-model.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
pie-relocation-model.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
placement-new.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
powerpc64le-struct-align-128.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
precondition-checks.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
ptr-arithmetic.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
ptr-read-metadata.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
range-attribute.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
range_to_inclusive.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
refs.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
reg-struct-return.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
regparm-inreg.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
repeat-trusted-len.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
riscv-target-abi.rs Always specify `llvm_abiname` for RISC-V targets 2024-10-17 02:07:02 +01:00
rust-abi-arch-specific-adjustment.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
s390x-simd.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
scalar-pair-bool.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
set-discriminant-invalid.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
skip-mono-inside-if-false.rs Avoid lowering code under dead SwitchInt targets 2024-03-12 19:01:04 -04:00
slice-as_chunks.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
slice-indexing.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
slice-init.rs Add more tests 2025-01-21 08:27:30 +00:00
slice-is-ascii.rs Add `is_ascii` function optimized for x86-64 for [u8] 2024-11-06 02:22:00 -05:00
slice-iter-fold.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
slice-iter-len-eq-zero.rs `transmute` should also assume non-null pointers 2025-02-12 23:01:27 -08:00
slice-iter-nonnull.rs Simplify `slice::Iter::next` enough that it inlines 2025-02-14 22:24:27 -08:00
slice-pointer-nonnull-unwrap.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
slice-position-bounds-check.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
slice-ref-equality.rs Set both `nuw` and `nsw` in slice size calculation 2025-02-13 21:26:48 -08:00
slice-reverse.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
slice-windows-no-bounds-check.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
slice_as_from_ptr_range.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
some-abis-do-extend-params-to-32-bits.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
some-global-nonnull.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
sparc-struct-abi.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
split-lto-unit.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
sroa-fragment-debuginfo.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
sse42-implies-crc32.rs Fix codegen tests 2024-08-07 00:41:48 -04:00
stack-probes-inline.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
stack-protector.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
static-relocation-model-msvc.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
staticlib-external-inline-fns.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
step_by-overflow-checks.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
stores.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
swap-large-types.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
swap-small-types.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
target-cpu-on-functions.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
target-feature-inline-closure.rs Stabilize target_feature_11 2025-01-27 23:44:47 +01:00
target-feature-overrides.rs ABI-required target features: warn when they are missing in base CPU (rather than silently enabling them) 2025-01-28 04:40:42 +01:00
terminating-catchpad.rs Generate correct terminate block under Wasm EH 2025-02-06 18:21:13 +03:00
thread-local.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
tied-features-strength.rs ABI-required target features: warn when they are missing in base CPU (rather than silently enabling them) 2025-01-28 04:40:42 +01:00
to_vec.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
trailing_zeros.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
transmute-optimized.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
transmute-scalar.rs Emit `trunc nuw` for unchecked shifts and `to_immediate_scalar` 2025-02-19 11:36:52 -08:00
try_question_mark_nop.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
tune-cpu-on-functions.rs Run rustfmt on `tests/codegen/`. 2024-05-31 15:56:43 +10:00
tuple-layout-opt.rs Fix test expectations for 32bit x86 2024-10-19 13:09:21 +00:00
ub-checks.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
unchecked-float-casts.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
unchecked_shifts.rs PR feedback 2025-02-19 11:36:52 -08:00
uninhabited-transparent-return-abi.rs Add test that uninhabited repr(transparent) type has same function return ABI as wrapped type. 2025-02-20 13:41:11 -06:00
uninit-consts.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
union-abi.rs Emit `trunc nuw` for unchecked shifts and `to_immediate_scalar` 2025-02-19 11:36:52 -08:00
unwind-and-panic-abort.rs Remove c_unwind from tests and fix tests 2024-06-19 13:54:55 +01:00
unwind-extern-exports.rs Remove c_unwind from tests and fix tests 2024-06-19 13:54:55 +01:00
unwind-extern-imports.rs Remove c_unwind from tests and fix tests 2024-06-19 13:54:55 +01:00
unwind-landingpad-cold.rs Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
unwind-landingpad-inline.rs Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
used_with_arg.rs
var-names.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-as-ptr.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-calloc.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-in-place.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-iter-collect-len.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-iter.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-len-invariant.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-optimizes-away.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-reserve-extend.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-shrink-panik.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec-with-capacity.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vec_pop_push_noop.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vecdeque-drain.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vecdeque-nonempty-get-no-panic.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vecdeque_no_panic.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vecdeque_pop_push.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
virtual-function-elimination-32bit.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
virtual-function-elimination.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vtable-loads.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
vtable-upcast.rs remove `feature(trait_upcasting)` from tests and bless them 2025-02-06 23:44:23 +01:00
wasm_casts_trapping.rs [AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
wasm_exceptions.rs Fix tests/codegen/wasm_exceptions 2025-01-28 19:10:26 +03:00
zip.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
zst-offset.rs Ban non-array SIMD 2024-09-09 19:39:43 -07:00

README.md

The files here use the LLVM FileCheck framework, documented at https://llvm.org/docs/CommandGuide/FileCheck.html.

One extension worth noting is the use of revisions as custom prefixes for FileCheck. If your codegen test has different behavior based on the chosen target or different compiler flags that you want to exercise, you can use a revisions annotation, like so:

// revisions: aaa bbb
// [bbb] compile-flags: --flags-for-bbb

After specifying those variations, you can write different expected, or explicitly unexpected output by using <prefix>-SAME: and <prefix>-NOT:, like so:

// CHECK: expected code
// aaa-SAME: emitted-only-for-aaa
// aaa-NOT:                        emitted-only-for-bbb
// bbb-NOT:  emitted-only-for-aaa
// bbb-SAME:                       emitted-only-for-bbb