diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-21 14:34:12 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-22 14:28:48 +0200 |
| commit | a27f3e3fd1e4d16160f8885b6b06665b5319f56c (patch) | |
| tree | b033935392cbadf6f85d2dbddf433a88e323aeeb /tests/codegen/issues/issue-121719-common-field-offset.rs | |
| parent | ed93c1783b404d728d4809973a0550eb33cd293f (diff) | |
| download | rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.tar.gz rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.zip | |
Rename `tests/codegen` into `tests/codegen-llvm`
Diffstat (limited to 'tests/codegen/issues/issue-121719-common-field-offset.rs')
| -rw-r--r-- | tests/codegen/issues/issue-121719-common-field-offset.rs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/codegen/issues/issue-121719-common-field-offset.rs b/tests/codegen/issues/issue-121719-common-field-offset.rs deleted file mode 100644 index 9f5f44e0375..00000000000 --- a/tests/codegen/issues/issue-121719-common-field-offset.rs +++ /dev/null @@ -1,44 +0,0 @@ -//! This test checks that match branches which all access a field -//! at the same offset are merged together. -//! -//@ compile-flags: -Copt-level=3 -#![crate_type = "lib"] - -#[repr(C)] -pub struct A { - x: f64, - y: u64, -} -#[repr(C)] -pub struct B { - x: f64, - y: u32, -} -#[repr(C)] -pub struct C { - x: f64, - y: u16, -} -#[repr(C)] -pub struct D { - x: f64, - y: u8, -} - -pub enum E { - A(A), - B(B), - C(C), - D(D), -} - -// CHECK-LABEL: @match_on_e -#[no_mangle] -pub fn match_on_e(e: &E) -> &f64 { - // CHECK: start: - // CHECK-NEXT: getelementptr - // CHECK-NEXT: ret - match e { - E::A(A { x, .. }) | E::B(B { x, .. }) | E::C(C { x, .. }) | E::D(D { x, .. }) => x, - } -} |
