mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 13:46:03 +00:00

The tests fail on s390x and presumably other big-endian systems, due to print of raw values and padding bytes. To fix the tests remove the raw output values in the error note with `normalize-stderr`.
23 lines
572 B
Rust
23 lines
572 B
Rust
//@ normalize-stderr: "[[:xdigit:]]{2} __ ([[:xdigit:]]{2}\s){2}" -> "HEX_DUMP"
|
|
#![feature(core_intrinsics)]
|
|
|
|
const RAW_EQ_PADDING: bool = unsafe {
|
|
std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
|
|
//~^ ERROR requires initialized memory
|
|
};
|
|
|
|
const RAW_EQ_PTR: bool = unsafe {
|
|
std::intrinsics::raw_eq(&(&0), &(&1))
|
|
//~^ ERROR unable to turn pointer into integer
|
|
};
|
|
|
|
const RAW_EQ_NOT_ALIGNED: bool = unsafe {
|
|
let arr = [0u8; 4];
|
|
let aref = &*arr.as_ptr().cast::<i32>();
|
|
std::intrinsics::raw_eq(aref, aref)
|
|
//~^ ERROR alignment
|
|
};
|
|
|
|
pub fn main() {
|
|
}
|