Commit c34e25a2 authored by Cyril SIX's avatar Cyril SIX
Browse files

Fixing packedstruct issue

parent f54e11c4
......@@ -26,10 +26,10 @@ TESTS_COMP?=attribs1 bitfields1 bitfields2 bitfields3 bitfields4 \
varargs1 varargs2 varargs3 sections alias aligned\
packedstruct1 packedstruct2
# FIXME ifeq ($(ARCH),mppa_k1c)
ifeq ($(ARCH),mppa_k1c)
TESTS_COMP:=$(filter-out packedstruct1,$(TESTS_COMP))
TESTS_COMP:=$(filter-out packedstruct2,$(TESTS_COMP))
# endif
endif
# Can run, both in compiled mode and in interpreter mode,
# but produce processor-dependent results, so no reference output in Results
......@@ -37,7 +37,7 @@ TESTS_COMP?=attribs1 bitfields1 bitfields2 bitfields3 bitfields4 \
TESTS_DIFF=NaNs
# FIXME ifeq ($(ARCH),mppa_k1c)
TESTS_DIFF:=$(filter-out NaNs,$(TESTS_DIFF))
# endif endif
# endif
# Other tests: should compile to .s without errors (but expect warnings)
......
......@@ -23,9 +23,9 @@ void test1(void)
struct s1 s1;
printf("sizeof(struct s1) = %d\n", szof(s1));
printf("precomputed sizeof(struct s1) = %d\n", bszof(s1));
printf("offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
offsetOf(s1,x), offsetOf(s1,y), offsetOf(s1,z));
printf("precomputed offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("precomputed offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
boffsetof(s1,x), boffsetof(s1,y), boffsetof(s1,z));
s1.x = 123; s1.y = -456; s1.z = 3.14159;
printf("s1 = {x = %d, y = %d, z = %.5f}\n\n", s1.x, s1.y, s1.z);
......@@ -44,9 +44,9 @@ void test2(void)
printf("sizeof(struct s2) = %d\n", szof(s2));
printf("precomputed sizeof(struct s2) = %d\n", bszof(s2));
printf("&s2 mod 16 = %d\n", ((int) &s2) & 0xF);
printf("offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
offsetOf(s2,x), offsetOf(s2,y), offsetOf(s2,z));
printf("precomputed offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("precomputed offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
boffsetof(s2,x), boffsetof(s2,y), boffsetof(s2,z));
s2.x = 12345; s2.y = -456; s2.z = 3.14159;
printf("s2 = {x = %d, y = %d, z = %.5f}\n\n", s2.x, s2.y, s2.z);
......@@ -73,8 +73,8 @@ void test3(void)
printf("sizeof(struct s3) = %d\n", szof(s3));
printf("precomputed sizeof(struct s3) = %d\n", bszof(s3));
printf("offsetOf(s) = %d\n", offsetOf(s3,s));
printf("precomputed offsetOf(s) = %d\n", boffsetof(s3,s));
printf("offsetof(s) = %d\n", offsetOf(s3,s));
printf("precomputed offsetof(s) = %d\n", boffsetof(s3,s));
s3.x = 123;
s3.y = 45678;
s3.z = 0x80000001U;
......@@ -103,9 +103,9 @@ void test4(void)
printf("sizeof(struct s4) = %d\n", szof(s4));
printf("precomputed sizeof(struct s4) = %d\n", bszof(s4));
printf("offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
offsetOf(s4,x), offsetOf(s4,y), offsetOf(s4,z));
printf("precomputed offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("precomputed offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
boffsetof(s4,x), boffsetof(s4,y), boffsetof(s4,z));
s4.x = 123; s4.y = -456; s4.z = 3.14159;
printf("s4 = {x = %d, y = %d, z = %.5f}\n\n", s4.x, s4.y, s4.z);
......@@ -121,9 +121,9 @@ void test5(void)
printf("sizeof(struct s5) = %d\n", szof(s5));
printf("precomputed sizeof(struct s5) = %d\n", bszof(s5));
printf("offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
offsetOf(s5,x), offsetOf(s5,y), offsetOf(s5,z));
printf("precomputed offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("precomputed offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
boffsetof(s5,x), boffsetof(s5,y), boffsetof(s5,z));
s5.x = 123; s5.y = -456; s5.z = 3.14159;
printf("s5 = {x = %d, y = %d, z = %.5f}\n\n", s5.x, s5.y, s5.z);
......@@ -139,9 +139,9 @@ void test6(void)
printf("sizeof(struct s6) = %d\n", szof(s6));
printf("precomputed sizeof(struct s6) = %d\n", bszof(s6));
printf("offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
offsetOf(s6,x), offsetOf(s6,y), offsetOf(s6,z));
printf("precomputed offsetOf(x) = %d, offsetOf(y) = %d, offsetOf(z) = %d\n",
printf("precomputed offsetof(x) = %d, offsetof(y) = %d, offsetof(z) = %d\n",
boffsetof(s6,x), boffsetof(s6,y), boffsetof(s6,z));
s62.x = 123; s62.y = -456; s62.z = 3.14159;
printf("s62 = {x = %d, y = %d, z = %.5f}\n\n", s62.x, s62.y, s62.z);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment