aboutsummaryrefslogtreecommitdiff
path: root/tests/abitest.c
diff options
context:
space:
mode:
authorJames Lyon <jamesly0n@hotmail.com>2013-04-19 22:55:09 +0100
committerJames Lyon <jamesly0n@hotmail.com>2013-04-19 22:55:09 +0100
commit23f73e92f3e6c8b16d19d894390af222e77a5ec4 (patch)
tree51d12efc629dbea0ec168ae957132c89737285a1 /tests/abitest.c
parentcbce6d2bac82351154edb69d6e8f78b4b8dcaa65 (diff)
downloadtinycc-23f73e92f3e6c8b16d19d894390af222e77a5ec4.tar.gz
tinycc-23f73e92f3e6c8b16d19d894390af222e77a5ec4.tar.bz2
Fixed 64-bit integer bug introduced by x86-64 ABI work.
Now I need to check that the x86-64 stuff still works.
Diffstat (limited to 'tests/abitest.c')
-rw-r--r--tests/abitest.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/abitest.c b/tests/abitest.c
index aa11cc7..7e3d34a 100644
--- a/tests/abitest.c
+++ b/tests/abitest.c
@@ -38,10 +38,10 @@ static int run_callback(const char *src, callback_type callback) {
return result;
}
-#define RET_PRIMITIVE_TEST(name, type) \
+#define RET_PRIMITIVE_TEST(name, type, val) \
static int ret_ ## name ## _test_callback(void *ptr) { \
type (*callback) (type) = (type(*)(type))ptr; \
- type x = 29; \
+ type x = val; \
type y = callback(x); \
return (y == x+x) ? 0 : -1; \
} \
@@ -51,11 +51,11 @@ static int run_callback(const char *src, callback_type callback) {
return run_callback(src, ret_ ## name ## _test_callback); \
}
-RET_PRIMITIVE_TEST(int, int)
-RET_PRIMITIVE_TEST(longlong, long long)
-RET_PRIMITIVE_TEST(float, float)
-RET_PRIMITIVE_TEST(double, double)
-RET_PRIMITIVE_TEST(longdouble, long double)
+RET_PRIMITIVE_TEST(int, int, 70000)
+RET_PRIMITIVE_TEST(longlong, long long, 4333369356528LL)
+RET_PRIMITIVE_TEST(float, float, 63.0)
+RET_PRIMITIVE_TEST(double, double, 14789798.0)
+RET_PRIMITIVE_TEST(longdouble, long double, 378943892.0)
/*
* ret_2float_test: