From 4815f7e668640ae968418307909f41a7eaabf050 Mon Sep 17 00:00:00 2001 From: James Miller Date: Wed, 17 Feb 2016 19:33:27 +1300 Subject: 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. --- src/rt/rust_test_helpers.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/rt') 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; +} -- cgit 1.4.1-3-g733a5