aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/rust/15 polyglot sharedlib/adder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/rust/15 polyglot sharedlib/adder.rs')
-rw-r--r--meson/test cases/rust/15 polyglot sharedlib/adder.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/meson/test cases/rust/15 polyglot sharedlib/adder.rs b/meson/test cases/rust/15 polyglot sharedlib/adder.rs
new file mode 100644
index 000000000..909535035
--- /dev/null
+++ b/meson/test cases/rust/15 polyglot sharedlib/adder.rs
@@ -0,0 +1,9 @@
+#[repr(C)]
+pub struct Adder {
+ pub number: i32
+}
+
+#[no_mangle]
+pub extern fn adder_add(a: &Adder, number: i32) -> i32 {
+ return a.number + number;
+}