rust/tests/codegen/issues/issue-114312.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
541 B
Rust
Raw Permalink Normal View History

//@ compile-flags: -Copt-level=3
2023-08-11 16:24:25 +00:00
//@ 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),
}
}