Skip to content

Commit

Permalink
Auto merge of #114726 - DianQK:beta, r=cuviper
Browse files Browse the repository at this point in the history
[beta] Update LLVM to resolve a miscompilation found in 114312.

Related issue: #114312 .

After the master updates the LLVM, we will add the same test cases. In the meantime, close the issue.
  • Loading branch information
bors committed Aug 12, 2023
2 parents d1fa3e4 + e241551 commit 598a0a3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
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-system-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),
}
}

0 comments on commit 598a0a3

Please sign in to comment.