aboutsummaryrefslogtreecommitdiff
path: root/tests/abitest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/abitest.c')
-rw-r--r--tests/abitest.c59
1 files changed, 5 insertions, 54 deletions
diff --git a/tests/abitest.c b/tests/abitest.c
index e2978b0..d3e151f 100644
--- a/tests/abitest.c
+++ b/tests/abitest.c
@@ -88,7 +88,7 @@ static int ret_2float_test_callback(void *ptr) {
ret_2float_test_type a = {10, 35};
ret_2float_test_type r;
r = f(a);
- return ((r.x == a.x*5) && (r.y == a.y*3) && (f(a).x == a.x*5) && (f(a).y == a.y*3)) ? 0 : -1;
+ return ((r.x == a.x*5) && (r.y == a.y*3)) ? 0 : -1;
}
static int ret_2float_test(void) {
@@ -116,7 +116,7 @@ static int ret_2double_test_callback(void *ptr) {
ret_2double_test_type a = {10, 35};
ret_2double_test_type r;
r = f(a);
- return ((r.x == a.x*5) && (r.y == a.y*3) && (f(a).x == a.x*5) && (f(a).y == a.y*3)) ? 0 : -1;
+ return ((r.x == a.x*5) && (r.y == a.y*3)) ? 0 : -1;
}
static int ret_2double_test(void) {
@@ -130,50 +130,6 @@ static int ret_2double_test(void) {
return run_callback(src, ret_2double_test_callback);
}
-typedef struct ret_longdouble_test_type_s2 {LONG_DOUBLE x;} ret_longdouble_test_type;
-typedef ret_longdouble_test_type (*ret_longdouble_test_function_type) (ret_longdouble_test_type);
-
-static int ret_longdouble_test_callback2(void *ptr) {
- ret_longdouble_test_function_type f = (ret_longdouble_test_function_type)ptr;
- ret_longdouble_test_type a = {10};
- ret_longdouble_test_type r;
- r = f(a);
- return ((r.x == a.x*5) && (f(a).x == a.x*5)) ? 0 : -1;
-}
-
-static int ret_longdouble_test2(void) {
- const char *src =
- "typedef struct ret_longdouble_test_type_s2 {long double x;} ret_longdouble_test_type;"
- "ret_longdouble_test_type f(ret_longdouble_test_type a) {\n"
- " ret_longdouble_test_type r = {a.x*5};\n"
- " return r;\n"
- "}\n";
-
- return run_callback(src, ret_longdouble_test_callback2);
-}
-
-typedef struct ret_longlong_test_type_s2 {int x[4];} ret_longlong_test_type;
-typedef ret_longlong_test_type (*ret_longlong_test_function_type) (ret_longlong_test_type);
-
-static int ret_longlong_test_callback2(void *ptr) {
- ret_longlong_test_function_type f = (ret_longlong_test_function_type)ptr;
- ret_longlong_test_type a = {{10,11,12,13}};
- ret_longlong_test_type r;
- r = f(a);
- return ((r.x[2] == a.x[2]*5) && (f(a).x[2] == a.x[2]*5)) ? 0 : -1;
-}
-
-static int ret_longlong_test2(void) {
- const char *src =
- "typedef struct ret_longlong_test_type_s2 {int x[4];} ret_longlong_test_type;"
- "ret_longlong_test_type f(ret_longlong_test_type a) {\n"
- " ret_longlong_test_type r = {.x[2] = a.x[2]*5};\n"
- " return r;\n"
- "}\n";
-
- return run_callback(src, ret_longlong_test_callback2);
-}
-
/*
* reg_pack_test: return a small struct which should be packed into
* registers (Win32) during return.
@@ -186,7 +142,7 @@ static int reg_pack_test_callback(void *ptr) {
reg_pack_test_type a = {10, 35};
reg_pack_test_type r;
r = f(a);
- return ((r.x == a.x*5) && (r.y == a.y*3) && (f(a).x == a.x*5) && (f(a).y == a.y*3)) ? 0 : -1;
+ return ((r.x == a.x*5) && (r.y == a.y*3)) ? 0 : -1;
}
static int reg_pack_test(void) {
@@ -212,7 +168,7 @@ static int reg_pack_longlong_test_callback(void *ptr) {
reg_pack_longlong_test_type a = {10, 35};
reg_pack_longlong_test_type r;
r = f(a);
- return ((r.x == a.x*5) && (r.y == a.y*3) && (f(a).x == a.x*5) && (f(a).y == a.y*3)) ? 0 : -1;
+ return ((r.x == a.x*5) && (r.y == a.y*3)) ? 0 : -1;
}
static int reg_pack_longlong_test(void) {
@@ -292,7 +248,7 @@ static int two_member_union_test_callback(void *ptr) {
two_member_union_test_type a, b;
a.x = 34;
b = f(a);
- return ((b.x == a.x*2) && (f(a).x == a.x*2)) ? 0 : -1;
+ return (b.x == a.x*2) ? 0 : -1;
}
static int two_member_union_test(void) {
@@ -485,11 +441,6 @@ int main(int argc, char **argv) {
RUN_TEST(ret_longdouble_test);
RUN_TEST(ret_2float_test);
RUN_TEST(ret_2double_test);
- RUN_TEST(ret_longlong_test2);
-#if !defined _WIN32 || !defined __GNUC__
- /* on win32, 'long double' is 10-byte with gcc, but is 'double' with tcc/msvc */
- RUN_TEST(ret_longdouble_test2);
-#endif
RUN_TEST(reg_pack_test);
RUN_TEST(reg_pack_longlong_test);
RUN_TEST(sret_test);