Skip to content

Commit

Permalink
Add test for rust-lang#114691
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Aug 15, 2023
1 parent 64cc56b commit 62ca87f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/ui/match/issue-114691.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// run-pass

// This test used to be miscompiled by LLVM 17.
#![allow(dead_code)]

enum Pass {
Opaque {
clear_color: [f32; 4],
with_depth_pre_pass: bool,
},
Transparent,
}

enum LoadOp {
Clear,
Load,
}

#[inline(never)]
fn check(x: Option<LoadOp>) {
assert!(x.is_none());
}

#[inline(never)]
fn test(mode: Pass) {
check(match mode {
Pass::Opaque {
with_depth_pre_pass: true,
..
}
| Pass::Transparent => None,
_ => Some(LoadOp::Clear),
});
}

fn main() {
println!("Hello, world!");
test(Pass::Transparent);
}

0 comments on commit 62ca87f

Please sign in to comment.