Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
18
tests/mir-opt/issues/issue_75439.rs
Normal file
18
tests/mir-opt/issues/issue_75439.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// EMIT_MIR issue_75439.foo.MatchBranchSimplification.diff
|
||||
|
||||
use std::mem::transmute;
|
||||
|
||||
pub fn foo(bytes: [u8; 16]) -> Option<[u8; 4]> {
|
||||
// big endian `u32`s
|
||||
let dwords: [u32; 4] = unsafe { transmute(bytes) };
|
||||
const FF: u32 = 0x0000_ffff_u32.to_be();
|
||||
if let [0, 0, 0 | FF, ip] = dwords {
|
||||
Some(unsafe { transmute(ip) })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = foo([0; 16]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue