regressions: Do not break strict aliasing rules in ck_pr validation tests.

Signed-off-by: Samy Al Bahra <sbahra@appnexus.com>
ck_pring
Samy Al Bahra 13 years ago committed by Samy Al Bahra
parent 941bc25734
commit 4d2f01b84d

@ -67,13 +67,13 @@
#define CK_PR_ADD_W(m, w) \
{ \
uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \
ck_pr_add_##w((uint##w##_t *)&t, 1); \
ck_pr_add_##w((uint##w##_t *)(void *)&t, 1); \
if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\
exit(EXIT_FAILURE); \
} \
t = 0, r = (uint##m##_t)(uint##w##_t)-1; \
ck_pr_add_##w((uint##w##_t *)&t, -1); \
ck_pr_add_##w((uint##w##_t *)(void *)&t, -1); \
if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\
exit(EXIT_FAILURE); \

@ -69,7 +69,7 @@
#define CK_PR_AND_W(m, w) \
{ \
uint##m##_t t = -1; \
ck_pr_and_##w((uint##w##_t *)&t, 0); \
ck_pr_and_##w((uint##w##_t *)(void *)&t, 0); \
if (t != BM(m, w)) { \
printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \
exit(EXIT_FAILURE); \

@ -72,7 +72,7 @@
#define CK_PR_CAS_W(m, w) \
{ \
uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \
ck_pr_cas_##w((uint##w##_t *)&t, (uint##w##_t)t, 0); \
ck_pr_cas_##w((uint##w##_t *)(void *)&t, (uint##w##_t)t, 0); \
if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", \
(uint##m##_t)t, (uint##m##_t)r); \

@ -65,7 +65,7 @@
#define CK_PR_DEC_W(m, w) \
{ \
uint##m##_t t = 0, r = (uint##w##_t)-1; \
ck_pr_dec_##w((uint##w##_t *)&t); \
ck_pr_dec_##w((uint##w##_t *)(void *)&t); \
if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\
exit(EXIT_FAILURE); \

@ -68,13 +68,13 @@
#define CK_PR_FAA_W(m, w) \
{ \
uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \
ck_pr_faa_##w((uint##w##_t *)&t, 1); \
ck_pr_faa_##w((uint##w##_t *)(void *)&t, 1); \
if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\
exit(EXIT_FAILURE); \
} \
t = 0, r = (uint##m##_t)(uint##w##_t)-1; \
ck_pr_faa_##w((uint##w##_t *)&t, -1); \
ck_pr_faa_##w((uint##w##_t *)(void *)&t, -1); \
if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\
exit(EXIT_FAILURE); \

@ -70,7 +70,7 @@
#define CK_PR_FAS_W(m, w) \
{ \
uint##m##_t t = 0; \
ck_pr_fas_##w((uint##w##_t *)&t, -1); \
ck_pr_fas_##w((uint##w##_t *)(void *)&t, -1); \
if (t != BM(m, w)) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \
exit(EXIT_FAILURE); \

@ -65,7 +65,7 @@
#define CK_PR_INC_W(m, w) \
{ \
uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \
ck_pr_inc_##w((uint##w##_t *)&t); \
ck_pr_inc_##w((uint##w##_t *)(void *)&t); \
if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\
exit(EXIT_FAILURE); \

@ -69,7 +69,7 @@
#define CK_PR_OR_W(m, w) \
{ \
uint##m##_t t = 0; \
ck_pr_or_##w((uint##w##_t *)&t, -1); \
ck_pr_or_##w((uint##w##_t *)(void *)&t, -1); \
if (t != BM(m, w)) { \
printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \
exit(EXIT_FAILURE); \

@ -65,7 +65,7 @@
{ \
uint##m##_t f = 0; \
uint##w##_t j = (uint##w##_t)-1; \
ck_pr_store_##w((uint##w##_t *)&f, j); \
ck_pr_store_##w((uint##w##_t *)(void *)&f, j); \
if (f != j) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##w "]\n", f, j);\
exit(EXIT_FAILURE); \

@ -67,13 +67,13 @@
#define CK_PR_SUB_W(m, w) \
{ \
uint##m##_t t = 0, r = (uint##m##_t)(uint##w##_t)-1; \
ck_pr_sub_##w((uint##w##_t *)&t, 1); \
ck_pr_sub_##w((uint##w##_t *)(void *)&t, 1); \
if (t != r) { \
printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r); \
exit(EXIT_FAILURE); \
} \
t = 0; \
ck_pr_sub_##w((uint##w##_t *)&t, -1); \
ck_pr_sub_##w((uint##w##_t *)(void *)&t, -1); \
if (t != 1) { \
printf(" FAIL [%#" PRIx##m " != 1]\n", t); \
exit(EXIT_FAILURE); \

@ -69,7 +69,7 @@
#define CK_PR_XOR_W(m, w) \
{ \
uint##m##_t t = -1; \
ck_pr_xor_##w((uint##w##_t *)&t, -1); \
ck_pr_xor_##w((uint##w##_t *)(void *)&t, -1); \
if (t != BM(m, w)) { \
printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \
exit(EXIT_FAILURE); \

Loading…
Cancel
Save