We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8fd588 commit 81e1247Copy full SHA for 81e1247
tests/codegen/issues/issue-114312.rs
@@ -0,0 +1,27 @@
1
+// compile-flags: -O
2
+// min-system-llvm-version: 17
3
+// only-x86_64-unknown-linux-gnu
4
+
5
+// We want to check that this function does not mis-optimize to loop jumping.
6
7
+#![crate_type = "lib"]
8
9
+#[repr(C)]
10
+pub enum Expr {
11
+ Sum,
12
+ // must have more than usize data
13
+ Sub(usize, u8),
14
+}
15
16
+#[no_mangle]
17
+pub extern "C" fn issue_114312(expr: Expr) {
18
+ // CHECK-LABEL: @issue_114312(
19
+ // CHECK-SAME: readonly
20
+ // CHECK-SAME: byval
21
+ // CHECK: bb1:
22
+ // CHECK-NEXT: br label %bb1
23
+ match expr {
24
+ Expr::Sum => {}
25
+ Expr::Sub(_, _) => issue_114312(Expr::Sum),
26
+ }
27
0 commit comments