about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2017-01-01 23:06:57 +0100
committerest31 <MTest31@outlook.com>2017-01-04 19:05:27 +0100
commit28f6d4a63786a7e63bc5d3b66b1754a02b1b564d (patch)
treeccaa1c92ffa4cd5171e7c41b62cb270f6a0ff8cb /src/rt
parent1fefa3cc91b6b2f8a0830d13d2955a9840431f31 (diff)
Add test for i128 ffi usage
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_test_helpers.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rt/rust_test_helpers.c b/src/rt/rust_test_helpers.c
index 7a04d377608..f2d9119a7d1 100644
--- a/src/rt/rust_test_helpers.c
+++ b/src/rt/rust_test_helpers.c
@@ -268,3 +268,22 @@ LARGE_INTEGER increment_all_parts(LARGE_INTEGER li) {
     li.QuadPart += 1;
     return li;
 }
+
+#define DO_INT128_TEST !(defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && \
+    defined(__amd64__)
+
+#if DO_INT128_TEST
+
+unsigned __int128 identity(unsigned __int128 a) {
+    return a;
+}
+
+__int128 square(__int128 a) {
+    return a * a;
+}
+
+__int128 sub(__int128 a, __int128 b) {
+    return a - b;
+}
+
+#endif