summaryrefslogtreecommitdiffstats
path: root/tests/rust/enum.toml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rust/enum.toml')
-rw-r--r--tests/rust/enum.toml39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/rust/enum.toml b/tests/rust/enum.toml
new file mode 100644
index 0000000..20073cf
--- /dev/null
+++ b/tests/rust/enum.toml
@@ -0,0 +1,39 @@
+header = """
+#if 0
+''' '
+#endif
+
+#ifdef __cplusplus
+template <typename T>
+using Box = T*;
+#endif
+
+#if 0
+' '''
+#endif
+"""
+
+trailer = """
+#if 0
+''' '
+#endif
+
+#include <stddef.h>
+#include "testing-helpers.h"
+static_assert(offsetof(CBINDGEN_STRUCT(P), tag) == 0, "unexpected offset for tag");
+static_assert(offsetof(CBINDGEN_STRUCT(P), p0) == 1, "unexpected offset for p0");
+static_assert(offsetof(CBINDGEN_STRUCT(P), p0) == 1, "unexpected offset for p1");
+static_assert(sizeof(CBINDGEN_STRUCT(P)) == 4, "unexpected size for P");
+
+#if 0
+' '''
+#endif
+"""
+
+[export]
+exclude = [
+ "Box",
+]
+
+[export.rename]
+"I" = "ExI"