summaryrefslogtreecommitdiffstats
path: root/tests/rust/enum_discriminant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rust/enum_discriminant.rs')
-rw-r--r--tests/rust/enum_discriminant.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/rust/enum_discriminant.rs b/tests/rust/enum_discriminant.rs
new file mode 100644
index 0000000..79c270f
--- /dev/null
+++ b/tests/rust/enum_discriminant.rs
@@ -0,0 +1,15 @@
+pub const FOUR: i8 = 4;
+
+#[repr(i8)]
+enum E {
+ A = 1,
+ B = -1,
+ C = 1 + 2,
+ D = FOUR,
+ F = (5),
+ G = b'6' as i8,
+ H = false as i8,
+}
+
+#[no_mangle]
+pub extern "C" fn root(_: &E) {}