rust/compiler/rustc_codegen_gcc/tests/run/switchint_128bit.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
871 B
Rust
Raw Permalink Normal View History

2025-05-09 19:22:33 +00:00
// Compiler:
//
// Run-time:
// status: 0
#![feature(no_core)]
#![no_std]
#![no_core]
#![no_main]
extern crate mini_core;
use intrinsics::black_box;
use mini_core::*;
#[no_mangle]
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
// 1st. Check that small 128 bit values work.
let val = black_box(64_u128);
match val {
0 => return 1,
1 => return 2,
64 => (),
_ => return 3,
}
// 2nd check that *large* values work.
const BIG: u128 = 0xDEAD_C0FE_BEEF_DECAF_BADD_DECAF_BEEF_u128;
let val = black_box(BIG);
match val {
0 => return 4,
1 => return 5,
// Check that we will not match on the lower u64, if the upper qword is different!
0xcafbadddecafbeef => return 6,
0xDEAD_C0FE_BEEF_DECAF_BADD_DECAF_BEEF_u128 => (),
_ => return 7,
}
0
}