2024-06-08 06:26:37 -05:00
|
|
|
//@ revisions: linux apple win
|
2024-03-10 15:04:12 -05:00
|
|
|
//@ compile-flags: -O -C no-prepopulate-passes
|
2018-01-20 10:09:55 -06:00
|
|
|
|
2024-03-09 22:07:27 -06:00
|
|
|
//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
|
|
|
|
//@[linux] needs-llvm-components: x86
|
|
|
|
//@[apple] compile-flags: --target x86_64-apple-darwin
|
|
|
|
//@[apple] needs-llvm-components: x86
|
2024-06-08 06:26:37 -05:00
|
|
|
//@[win] compile-flags: --target x86_64-pc-windows-msvc
|
|
|
|
//@[win] needs-llvm-components: x86
|
2024-03-09 22:07:27 -06:00
|
|
|
|
|
|
|
#![feature(no_core, lang_items)]
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![no_std]
|
|
|
|
#![no_core]
|
|
|
|
|
2024-05-28 23:11:20 -05:00
|
|
|
#[lang = "sized"]
|
|
|
|
trait Sized {}
|
|
|
|
#[lang = "freeze"]
|
|
|
|
trait Freeze {}
|
|
|
|
#[lang = "copy"]
|
|
|
|
trait Copy {}
|
2018-01-20 10:09:55 -06:00
|
|
|
|
|
|
|
#[repr(C)]
|
2024-05-28 23:11:20 -05:00
|
|
|
pub struct Rgb8 {
|
|
|
|
r: u8,
|
|
|
|
g: u8,
|
|
|
|
b: u8,
|
|
|
|
}
|
2018-01-20 10:09:55 -06:00
|
|
|
|
|
|
|
#[repr(transparent)]
|
|
|
|
pub struct Rgb8Wrap(Rgb8);
|
|
|
|
|
2019-12-31 09:05:11 -06:00
|
|
|
// CHECK: i24 @test_Rgb8Wrap(i24{{( %0)?}})
|
2018-01-20 10:09:55 -06:00
|
|
|
#[no_mangle]
|
2024-05-28 23:11:20 -05:00
|
|
|
pub extern "sysv64" fn test_Rgb8Wrap(_: Rgb8Wrap) -> Rgb8Wrap {
|
|
|
|
loop {}
|
|
|
|
}
|
2018-01-20 10:09:55 -06:00
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
pub union FloatBits {
|
|
|
|
float: f32,
|
|
|
|
bits: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(transparent)]
|
|
|
|
pub struct SmallUnion(FloatBits);
|
|
|
|
|
2019-12-31 09:05:11 -06:00
|
|
|
// CHECK: i32 @test_SmallUnion(i32{{( %0)?}})
|
2018-01-20 10:09:55 -06:00
|
|
|
#[no_mangle]
|
2024-05-28 23:11:20 -05:00
|
|
|
pub extern "sysv64" fn test_SmallUnion(_: SmallUnion) -> SmallUnion {
|
|
|
|
loop {}
|
|
|
|
}
|