comparison test/test_arith.h @ 17:41dd962abdd1

*: allow compiling vec in a C++ translation unit this is stupid, but whatever
author Paper <paper@tflc.us>
date Wed, 20 Nov 2024 12:02:15 -0500
parents e05c257c6a23
children e26874655738
comparison
equal deleted inserted replaced
16:9da2aba90c87 17:41dd962abdd1
67 67
68 #define CREATE_TESTS(bits, size) \ 68 #define CREATE_TESTS(bits, size) \
69 CREATE_TESTS_SIGN(, d, , bits, size) \ 69 CREATE_TESTS_SIGN(, d, , bits, size) \
70 CREATE_TESTS_SIGN(u, u, U, bits, size) 70 CREATE_TESTS_SIGN(u, u, U, bits, size)
71 71
72 CREATE_TESTS(8, 2)
73
74 CREATE_TESTS(8, 4)
75 CREATE_TESTS(16, 2)
76
72 CREATE_TESTS(8, 8) 77 CREATE_TESTS(8, 8)
73 CREATE_TESTS(16, 4) 78 CREATE_TESTS(16, 4)
74 CREATE_TESTS(32, 2) 79 CREATE_TESTS(32, 2)
75 80
76 CREATE_TESTS(8, 16) 81 CREATE_TESTS(8, 16)
89 CREATE_TESTS(64, 8) 94 CREATE_TESTS(64, 8)
90 95
91 #undef CREATE_TESTS_SIGN 96 #undef CREATE_TESTS_SIGN
92 #undef CREATE_TESTS 97 #undef CREATE_TESTS
93 #undef CREATE_TEST 98 #undef CREATE_TEST
99 #undef CREATE_TEST_SHIFT
94 100
95 static int test_arith(void) 101 static int test_arith(void)
96 { 102 {
97 int ret = 0; 103 int ret = 0;
98 104
124 130
125 #define RUN_TESTS(bits, size) \ 131 #define RUN_TESTS(bits, size) \
126 RUN_TESTS_SIGN( , bits, size) \ 132 RUN_TESTS_SIGN( , bits, size) \
127 RUN_TESTS_SIGN(u, bits, size) 133 RUN_TESTS_SIGN(u, bits, size)
128 134
135 RUN_TESTS(8, 2)
136
137 RUN_TESTS(8, 4)
138 RUN_TESTS(16, 2)
139
129 RUN_TESTS(8, 8) 140 RUN_TESTS(8, 8)
130 RUN_TESTS(16, 4) 141 RUN_TESTS(16, 4)
131 RUN_TESTS(32, 2) 142 RUN_TESTS(32, 2)
132 143
133 RUN_TESTS(8, 16) 144 RUN_TESTS(8, 16)