Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LLVM submodule #114847

Merged
merged 3 commits into from
Aug 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Cherry-pick test for issue #114312
  • Loading branch information
DianQK authored and nikic committed Aug 15, 2023
commit c12c0841ad01d1239a1bd009610da2263ecde40b
27 changes: 27 additions & 0 deletions tests/codegen/issues/issue-114312.rs
Original file line number Diff line number Diff line change
@@ -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),
}
}