aboutsummaryrefslogtreecommitdiff
path: root/test_cases/info_tests/variant/simple.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test_cases/info_tests/variant/simple.rs')
-rw-r--r--test_cases/info_tests/variant/simple.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test_cases/info_tests/variant/simple.rs b/test_cases/info_tests/variant/simple.rs
new file mode 100644
index 0000000..5f080ec
--- /dev/null
+++ b/test_cases/info_tests/variant/simple.rs
@@ -0,0 +1,14 @@
+#[repr(u8)]
+pub enum Foo {
+ Unit,
+ TwoU32s(u32, u32),
+ ThreeI16s { x: i16, y: i16, z: i16 },
+}
+
+#[no_mangle]
+pub fn is_unit(foo: Foo) -> bool {
+ match foo {
+ Foo::Unit => true,
+ _ => false,
+ }
+}