xref: /aosp_15_r20/external/stg/test_cases/info_tests/variant/simple.rs (revision 9e3b08ae94a55201065475453d799e8b1378bea6)
1 #[repr(u8)]
2 pub enum Foo {
3     Unit,
4     TwoU32s(u32, u32),
5     ThreeI16s { x: i16, y: i16, z: i16 },
6 }
7 
8 #[no_mangle]
is_unit(foo: Foo) -> bool9 pub fn is_unit(foo: Foo) -> bool {
10     match foo {
11         Foo::Unit => true,
12         _ => false,
13     }
14 }
15