File tree Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 3333[submodule "src/llvm-project "]
3434 path = src/llvm-project
3535 url = https://github.com/rust-lang/llvm-project.git
36- branch = rustc/17.0-2023-07-29
36+ branch = rustc/17.0-2023-09-19
3737 shallow = true
3838[submodule "src/doc/embedded-book "]
3939 path = src/doc/embedded-book
Original file line number Diff line number Diff line change 1+ // run-pass
2+ // compile-flags: -C opt-level=1
3+
4+ // Make sure LLVM does not miscompile this match.
5+ fn main ( ) {
6+ enum Bits {
7+ None = 0x00 ,
8+ Low = 0x40 ,
9+ High = 0x80 ,
10+ Both = 0xC0 ,
11+ }
12+
13+ let value = Box :: new ( 0x40u8 ) ;
14+ let mut out = Box :: new ( 0u8 ) ;
15+
16+ let bits = match * value {
17+ 0x00 => Bits :: None ,
18+ 0x40 => Bits :: Low ,
19+ 0x80 => Bits :: High ,
20+ 0xC0 => Bits :: Both ,
21+ _ => return ,
22+ } ;
23+
24+ match bits {
25+ Bits :: None | Bits :: Low => {
26+ * out = 1 ;
27+ }
28+ _ => ( ) ,
29+ }
30+
31+ assert_eq ! ( * out, 1 ) ;
32+ }
You can’t perform that action at this time.
0 commit comments