mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 13:36:49 +00:00

Per discussion in #137799 we don't really need this readonly attribute, so let's just drop it so the test passes on LLVM 21. Fixes #137799.
26 lines
541 B
Rust
26 lines
541 B
Rust
//@ compile-flags: -Copt-level=3
|
|
//@ only-x86_64-unknown-linux-gnu
|
|
|
|
// We want to check that this function does not mis-optimize to loop jumping.
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#[repr(C)]
|
|
pub enum Expr {
|
|
Sum,
|
|
// must have more than usize data
|
|
Sub(usize, u8),
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn issue_114312(expr: Expr) {
|
|
// CHECK-LABEL: @issue_114312(
|
|
// CHECK-SAME: byval
|
|
// CHECK-NEXT: start:
|
|
// CHECK-NEXT: ret void
|
|
match expr {
|
|
Expr::Sum => {}
|
|
Expr::Sub(_, _) => issue_114312(Expr::Sum),
|
|
}
|
|
}
|