about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorJames Miller <james@aatch.net>2016-02-17 19:33:27 +1300
committerBjörn Steinbrink <bsteinbr@gmail.com>2016-04-04 22:14:10 +0200
commit4815f7e668640ae968418307909f41a7eaabf050 (patch)
treeab8fa6b63eeb27a7dfa55a62b71a230199b21a35 /src/rt
parentf92ce2e9fe56942e0fd6a18d0e11bc4a9bdf8ddd (diff)
downloadrust-4815f7e668640ae968418307909f41a7eaabf050.tar.gz
rust-4815f7e668640ae968418307909f41a7eaabf050.zip
Handle integer-extending for C ABI
We need to supply sext/zext attributes to LLVM to ensure that arguments
are extended to the appropriate width in the correct way.

Most platforms extend integers less than 32 bits, though not all.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_test_helpers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rt/rust_test_helpers.c b/src/rt/rust_test_helpers.c
index 00bfa63e6fe..d2ebdcca80c 100644
--- a/src/rt/rust_test_helpers.c
+++ b/src/rt/rust_test_helpers.c
@@ -243,3 +243,7 @@ double rust_interesting_average(uint64_t n, ...) {
     va_end(pairs);
     return sum / n;
 }
+
+int32_t rust_int8_to_int32(int8_t x) {
+    return (int32_t)x;
+}