]> git.proxmox.com Git - rustc.git/blame - src/test/ui/layout/hexagon-enum.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / layout / hexagon-enum.rs
CommitLineData
6a06907d
XL
1// compile-flags: --target hexagon-unknown-linux-musl
2// needs-llvm-components: hexagon
3//
4// Verify that the hexagon targets implement the repr(C) for enums correctly.
5//
6// See #82100
7#![feature(never_type, rustc_attrs, no_core, lang_items)]
8#![crate_type = "lib"]
9#![no_core]
10
11#[lang="sized"]
12trait Sized {}
13
14#[rustc_layout(debug)]
15#[repr(C)]
16enum A { Apple } //~ ERROR: layout_of
17
18#[rustc_layout(debug)]
19#[repr(C)]
20enum B { Banana = 255, } //~ ERROR: layout_of
21
22#[rustc_layout(debug)]
23#[repr(C)]
24enum C { Chaenomeles = 256, } //~ ERROR: layout_of
25
26#[rustc_layout(debug)]
27#[repr(C)]
28enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of
29
30const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator!
31
32#[rustc_layout(debug)]
33#[repr(C)]
34enum T { Tangerine = TANGERINE as isize } //~ ERROR: layout_of