mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 04:04:06 +00:00
20 lines
384 B
Rust
20 lines
384 B
Rust
|
//@ compile-flags: -O
|
||
|
//@ min-llvm-version: 19
|
||
|
|
||
|
#![crate_type = "lib"]
|
||
|
|
||
|
pub enum State {
|
||
|
A([u8; 753]),
|
||
|
B([u8; 753]),
|
||
|
}
|
||
|
|
||
|
// CHECK-LABEL: @update
|
||
|
#[no_mangle]
|
||
|
pub unsafe fn update(s: *mut State) {
|
||
|
// CHECK-NEXT: start:
|
||
|
// CHECK-NEXT: store i8
|
||
|
// CHECK-NEXT: ret
|
||
|
let State::A(v) = s.read() else { std::hint::unreachable_unchecked() };
|
||
|
s.write(State::B(v));
|
||
|
}
|