mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Cherry-pick test for issue #114312
This commit is contained in:
parent
62ca87f45d
commit
c12c0841ad
27
tests/codegen/issues/issue-114312.rs
Normal file
27
tests/codegen/issues/issue-114312.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// compile-flags: -O
|
||||
// min-llvm-version: 17
|
||||
// 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-NOT: readonly
|
||||
// CHECK-SAME: byval
|
||||
// CHECK-NEXT: start:
|
||||
// CHECK-NEXT: ret void
|
||||
match expr {
|
||||
Expr::Sum => {}
|
||||
Expr::Sub(_, _) => issue_114312(Expr::Sum),
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user