about summary refs log tree commit diff
path: root/tests/codegen/enum
AgeCommit message (Collapse)AuthorLines
2024-09-18Update the minimum external LLVM to 18Josh Stone-1/+0
2024-09-14Simplify the canonical clone method to copyDianQK-2/+4
The optimized clone method ends up as the following MIR: ``` _2 = copy ((*_1).0: i32); _3 = copy ((*_1).1: u64); _4 = copy ((*_1).2: [i8; 3]); _0 = Foo { a: move _2, b: move _3, c: move _4 }; ``` We can transform this to: ``` _0 = copy (*_1); ```
2024-08-11Add range attribute to scalar function results and argumentsAndreas Jonson-1/+1
2024-05-31Run rustfmt on `tests/codegen/`.Nicholas Nethercote-12/+21
Except for `simd-intrinsic/`, which has a lot of files containing multiple types like `u8x64` which really are better when hand-formatted. There is a surprising amount of two-space indenting in this directory. Non-trivial changes: - `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the test. - `rustfmt::skip` used in a few places where hand-formatting read more nicely: `enum/enum-match.rs` - Line number adjustments needed for the expected output of `debug-column.rs` and `coroutine-debug.rs`.
2024-04-30codegen tests: Tolerate `range()` qualifications in enum testsMatthew Maurer-3/+3
Current LLVM can infer range bounds on the i8s involved with these tests, and annotates it. Accept these bounds if present.
2024-04-24Auto merge of #122053 - erikdesjardins:alloca, r=nikicbors-1/+1
Stop using LLVM struct types for alloca The alloca type has no semantic meaning, only the size (and alignment, but we specify it explicitly) matter. Using `[N x i8]` is a more direct way to specify that we want `N` bytes, and avoids relying on LLVM's struct layout. It is likely that a future LLVM version will change to an untyped alloca representation. Split out from #121577. r? `@ghost`
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+1
2024-04-11use [N x i8] for alloca typesErik Desjardins-1/+1
2024-04-08Add test case for #119014DianQK-0/+26
2024-04-03Auto merge of #122225 - DianQK:nits-120268, r=cjgillotbors-24/+43
Rename `UninhabitedEnumBranching` to `UnreachableEnumBranching` Per [#120268](https://github.com/rust-lang/rust/pull/120268#discussion_r1517492060), I rename `UninhabitedEnumBranching` to `UnreachableEnumBranching` . I solved some nits to add some comments. I adjusted the workaround restrictions. This should be useful for `a <= b` and `if let Some/Ok(v)`. For enum with few variants, `early-tailduplication` should not cause compile time overhead. r? RalfJung
2024-03-13Update `unreachable_enum_default_branch.rs`DianQK-24/+43
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-0/+4
* 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-07Replace the default branch with an unreachable branch If it is the last variantDianQK-0/+24
2024-02-25Use generic `NonZero` in tests.Markus Reiter-10/+7
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-17/+17
2023-07-29tests/codegen/enum-* -> enum/enum-*Jubilee Young-0/+381