test_stdatomic.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. /*
  2. * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Unlicense OR CC0-1.0
  5. */
  6. #include <assert.h>
  7. #include <stdint.h>
  8. #include <stddef.h>
  9. #include <stdbool.h>
  10. #include <stdatomic.h>
  11. #include <stdio.h>
  12. #include <pthread.h>
  13. #include "esp_pthread.h"
  14. #include "freertos/portmacro.h"
  15. #include "unity.h"
  16. #include "unity_fixture.h"
  17. /* non-static to prevent optimization */
  18. atomic_ullong g_atomic64;
  19. atomic_uint g_atomic32;
  20. atomic_ushort g_atomic16;
  21. atomic_uchar g_atomic8;
  22. TEST_GROUP(stdatomic);
  23. TEST_SETUP(stdatomic)
  24. {
  25. }
  26. TEST_TEAR_DOWN(stdatomic)
  27. {
  28. }
  29. TEST(stdatomic, test_64bit_atomics_fetch_op)
  30. {
  31. unsigned long long x64 = 0;
  32. g_atomic64 = 0; // calls atomic_store
  33. x64 += atomic_fetch_or (&g_atomic64, 0x1111111111111111ULL);
  34. x64 += atomic_fetch_xor(&g_atomic64, 0x3333333333333333ULL);
  35. x64 += atomic_fetch_and(&g_atomic64, 0xf0f0f0f0f0f0f0f0ULL);
  36. x64 += atomic_fetch_sub(&g_atomic64, 0x0f0f0f0f0f0f0f0fULL);
  37. x64 += atomic_fetch_add(&g_atomic64, 0x2222222222222222ULL);
  38. #ifndef __clang__
  39. x64 += __atomic_fetch_nand_8 (&g_atomic64, 0xAAAAAAAAAAAAAAAAULL, 0);
  40. TEST_ASSERT_EQUAL_HEX64(0x9797979797979797ULL, x64);
  41. TEST_ASSERT_EQUAL_HEX64(0xDDDDDDDDDDDDDDDDULL, g_atomic64); // calls atomic_load
  42. #else
  43. TEST_ASSERT_EQUAL_HEX64(0x6464646464646464ULL, x64);
  44. TEST_ASSERT_EQUAL_HEX64(0x3333333333333333ULL, g_atomic64); // calls atomic_load
  45. #endif
  46. }
  47. TEST(stdatomic, test_32bit_atomics_fetch_op)
  48. {
  49. unsigned int x32 = 0;
  50. g_atomic32 = 0;
  51. x32 += atomic_fetch_or (&g_atomic32, 0x11111111U);
  52. x32 += atomic_fetch_xor(&g_atomic32, 0x33333333U);
  53. x32 += atomic_fetch_and(&g_atomic32, 0xf0f0f0f0U);
  54. x32 += atomic_fetch_sub(&g_atomic32, 0x0f0f0f0fU);
  55. x32 += atomic_fetch_add(&g_atomic32, 0x22222222U);
  56. #ifndef __clang__
  57. x32 += __atomic_fetch_nand_4 (&g_atomic32, 0xAAAAAAAAU, 0);
  58. TEST_ASSERT_EQUAL_HEX32(0x97979797U, x32);
  59. TEST_ASSERT_EQUAL_HEX32(0xDDDDDDDDU, g_atomic32);
  60. #else
  61. TEST_ASSERT_EQUAL_HEX32(0x64646464U, x32);
  62. TEST_ASSERT_EQUAL_HEX32(0x33333333U, g_atomic32); // calls atomic_load
  63. #endif
  64. }
  65. TEST(stdatomic, test_16bit_atomics_fetch_op)
  66. {
  67. unsigned int x16 = 0;
  68. g_atomic16 = 0;
  69. x16 += atomic_fetch_or (&g_atomic16, 0x1111);
  70. x16 += atomic_fetch_xor(&g_atomic16, 0x3333);
  71. x16 += atomic_fetch_and(&g_atomic16, 0xf0f0);
  72. x16 += atomic_fetch_sub(&g_atomic16, 0x0f0f);
  73. x16 += atomic_fetch_add(&g_atomic16, 0x2222);
  74. #ifndef __clang__
  75. x16 += __atomic_fetch_nand_2 (&g_atomic16, 0xAAAA, 0);
  76. TEST_ASSERT_EQUAL_HEX16(0x9797, x16);
  77. TEST_ASSERT_EQUAL_HEX16(0xDDDD, g_atomic16);
  78. #else
  79. TEST_ASSERT_EQUAL_HEX16(0x6464, x16);
  80. TEST_ASSERT_EQUAL_HEX16(0x3333, g_atomic16); // calls atomic_load
  81. #endif
  82. }
  83. TEST(stdatomic, test_8bit_atomics_fetch_op)
  84. {
  85. unsigned int x8 = 0;
  86. g_atomic8 = 0;
  87. x8 += atomic_fetch_or (&g_atomic8, 0x11);
  88. x8 += atomic_fetch_xor(&g_atomic8, 0x33);
  89. x8 += atomic_fetch_and(&g_atomic8, 0xf0);
  90. x8 += atomic_fetch_sub(&g_atomic8, 0x0f);
  91. x8 += atomic_fetch_add(&g_atomic8, 0x22);
  92. #ifndef __clang__
  93. x8 += __atomic_fetch_nand_1 (&g_atomic8, 0xAA, 0);
  94. TEST_ASSERT_EQUAL_HEX8(0x97, x8);
  95. TEST_ASSERT_EQUAL_HEX8(0xDD, g_atomic8);
  96. #else
  97. TEST_ASSERT_EQUAL_HEX8(0x64, x8);
  98. TEST_ASSERT_EQUAL_HEX8(0x33, g_atomic8); // calls atomic_load
  99. #endif
  100. }
  101. #ifndef __clang__
  102. TEST(stdatomic, test_64bit_atomics_op_fetch)
  103. {
  104. unsigned long long x64 = 0;
  105. g_atomic64 = 0; // calls atomic_store
  106. x64 += __atomic_or_fetch_8 (&g_atomic64, 0x1111111111111111ULL, 0);
  107. x64 += __atomic_xor_fetch_8(&g_atomic64, 0x3333333333333333ULL, 0);
  108. x64 += __atomic_and_fetch_8(&g_atomic64, 0xf0f0f0f0f0f0f0f0ULL, 0);
  109. x64 += __atomic_sub_fetch_8(&g_atomic64, 0x0f0f0f0f0f0f0f0fULL, 0);
  110. x64 += __atomic_add_fetch_8(&g_atomic64, 0x2222222222222222ULL, 0);
  111. x64 += __atomic_nand_fetch_8(&g_atomic64, 0xAAAAAAAAAAAAAAAAULL, 0);
  112. TEST_ASSERT_EQUAL_HEX64(0x7575757575757574ULL, x64);
  113. TEST_ASSERT_EQUAL_HEX64(0xDDDDDDDDDDDDDDDDULL, g_atomic64); // calls atomic_load
  114. }
  115. TEST(stdatomic, test_32bit_atomics_op_fetch)
  116. {
  117. unsigned int x32 = 0;
  118. g_atomic32 = 0;
  119. x32 += __atomic_or_fetch_4 (&g_atomic32, 0x11111111U, 0);
  120. x32 += __atomic_xor_fetch_4(&g_atomic32, 0x33333333U, 0);
  121. x32 += __atomic_and_fetch_4(&g_atomic32, 0xf0f0f0f0U, 0);
  122. x32 += __atomic_sub_fetch_4(&g_atomic32, 0x0f0f0f0fU, 0);
  123. x32 += __atomic_add_fetch_4(&g_atomic32, 0x22222222U, 0);
  124. x32 += __atomic_nand_fetch_4 (&g_atomic32, 0xAAAAAAAAU, 0);
  125. TEST_ASSERT_EQUAL_HEX32(0x75757574U, x32);
  126. TEST_ASSERT_EQUAL_HEX32(0xDDDDDDDDU, g_atomic32);
  127. }
  128. TEST(stdatomic, test_16bit_atomics_op_fetch)
  129. {
  130. unsigned int x16 = 0;
  131. g_atomic16 = 0;
  132. x16 += __atomic_or_fetch_2 (&g_atomic16, 0x1111, 0);
  133. x16 += __atomic_xor_fetch_2(&g_atomic16, 0x3333, 0);
  134. x16 += __atomic_and_fetch_2(&g_atomic16, 0xf0f0, 0);
  135. x16 += __atomic_sub_fetch_2(&g_atomic16, 0x0f0f, 0);
  136. x16 += __atomic_add_fetch_2(&g_atomic16, 0x2222, 0);
  137. x16 += __atomic_nand_fetch_2 (&g_atomic16, 0xAAAA, 0);
  138. TEST_ASSERT_EQUAL_HEX16(0x7574, x16);
  139. TEST_ASSERT_EQUAL_HEX16(0xDDDD, g_atomic16);
  140. }
  141. TEST(stdatomic, test_8bit_atomics_op_fetch)
  142. {
  143. unsigned int x8 = 0;
  144. g_atomic8 = 0;
  145. x8 += __atomic_or_fetch_1 (&g_atomic8, 0x11, 0);
  146. x8 += __atomic_xor_fetch_1(&g_atomic8, 0x33, 0);
  147. x8 += __atomic_and_fetch_1(&g_atomic8, 0xf0, 0);
  148. x8 += __atomic_sub_fetch_1(&g_atomic8, 0x0f, 0);
  149. x8 += __atomic_add_fetch_1(&g_atomic8, 0x22, 0);
  150. x8 += __atomic_nand_fetch_1 (&g_atomic8, 0xAA, 0);
  151. TEST_ASSERT_EQUAL_HEX8(0x74, x8);
  152. TEST_ASSERT_EQUAL_HEX8(0xDD, g_atomic8);
  153. }
  154. #endif // #ifndef __clang__
  155. #define TEST_EXCLUSION(n) TEST(stdatomic, test_ ## n ## bit_exclusion) \
  156. { \
  157. g_atomic ## n = 0; \
  158. pthread_t thread1; \
  159. pthread_t thread2; \
  160. esp_pthread_cfg_t cfg = esp_pthread_get_default_config(); \
  161. cfg.pin_to_core = (xPortGetCoreID() + 1) % portNUM_PROCESSORS; \
  162. esp_pthread_set_cfg(&cfg); \
  163. pthread_create(&thread1, NULL, exclusion_task_ ## n, (void*) 1); \
  164. cfg.pin_to_core = xPortGetCoreID(); \
  165. esp_pthread_set_cfg(&cfg); \
  166. pthread_create(&thread2, NULL, exclusion_task_ ## n, (void*) 0); \
  167. pthread_join(thread1, NULL); \
  168. pthread_join(thread2, NULL); \
  169. TEST_ASSERT_EQUAL(0, g_atomic ## n); \
  170. }
  171. #define TEST_EXCLUSION_TASK(n) static void* exclusion_task_ ## n(void *varg) \
  172. { \
  173. int arg = (int) varg; \
  174. for (int i = 0; i < 1000000; ++i) { \
  175. if (arg == 0) { \
  176. atomic_fetch_add(&g_atomic ## n, 1ULL); \
  177. } else { \
  178. atomic_fetch_sub(&g_atomic ## n, 1ULL); \
  179. } \
  180. } \
  181. return NULL; \
  182. }
  183. TEST_EXCLUSION_TASK(64)
  184. TEST_EXCLUSION(64)
  185. TEST_EXCLUSION_TASK(32)
  186. TEST_EXCLUSION(32)
  187. TEST_EXCLUSION_TASK(16)
  188. TEST_EXCLUSION(16)
  189. TEST_EXCLUSION_TASK(8)
  190. TEST_EXCLUSION(8)
  191. #define ITER_COUNT 20000
  192. #define TEST_RACE_OPERATION(NAME, LHSTYPE, PRE, POST, INIT, FINAL) \
  193. \
  194. static _Atomic LHSTYPE var_##NAME = (INIT); \
  195. \
  196. static void *test_thread_##NAME (void *arg) \
  197. { \
  198. for (int i = 0; i < ITER_COUNT; i++) \
  199. { \
  200. PRE var_##NAME POST; \
  201. } \
  202. return NULL; \
  203. } \
  204. \
  205. TEST(stdatomic, test_ ##NAME) \
  206. { \
  207. pthread_t thread_id1; \
  208. pthread_t thread_id2; \
  209. esp_pthread_cfg_t cfg = esp_pthread_get_default_config(); \
  210. cfg.pin_to_core = (xPortGetCoreID() + 1) % portNUM_PROCESSORS; \
  211. esp_pthread_set_cfg(&cfg); \
  212. pthread_create (&thread_id1, NULL, test_thread_##NAME, NULL); \
  213. cfg.pin_to_core = xPortGetCoreID(); \
  214. esp_pthread_set_cfg(&cfg); \
  215. pthread_create (&thread_id2, NULL, test_thread_##NAME, NULL); \
  216. pthread_join (thread_id1, NULL); \
  217. pthread_join (thread_id2, NULL); \
  218. TEST_ASSERT_EQUAL((FINAL), var_##NAME); \
  219. }
  220. TEST_RACE_OPERATION (uint8_add, uint8_t, , += 1, 0, (uint8_t) (2*ITER_COUNT))
  221. TEST_RACE_OPERATION (uint8_add_3, uint8_t, , += 3, 0, (uint8_t) (6*ITER_COUNT))
  222. TEST_RACE_OPERATION (uint8_postinc, uint8_t, , ++, 0, (uint8_t) (2*ITER_COUNT))
  223. TEST_RACE_OPERATION (uint8_preinc, uint8_t, ++, , 0, (uint8_t) (2*ITER_COUNT))
  224. TEST_RACE_OPERATION (uint8_sub, uint8_t, , -= 1, 0, (uint8_t) -(2*ITER_COUNT))
  225. TEST_RACE_OPERATION (uint8_sub_3, uint8_t, , -= 3, 0, (uint8_t) -(6*ITER_COUNT))
  226. TEST_RACE_OPERATION (uint8_postdec, uint8_t, , --, 0, (uint8_t) -(2*ITER_COUNT))
  227. TEST_RACE_OPERATION (uint8_predec, uint8_t, --, , 0, (uint8_t) -(2*ITER_COUNT))
  228. TEST_RACE_OPERATION (uint8_mul, uint8_t, , *= 3, 1, (uint8_t) 0x1)
  229. TEST_RACE_OPERATION (uint16_add, uint16_t, , += 1, 0, (uint16_t) (2*ITER_COUNT))
  230. TEST_RACE_OPERATION (uint16_add_3, uint16_t, , += 3, 0, (uint16_t) (6*ITER_COUNT))
  231. TEST_RACE_OPERATION (uint16_postinc, uint16_t, , ++, 0, (uint16_t) (2*ITER_COUNT))
  232. TEST_RACE_OPERATION (uint16_preinc, uint16_t, ++, , 0, (uint16_t) (2*ITER_COUNT))
  233. TEST_RACE_OPERATION (uint16_sub, uint16_t, , -= 1, 0, (uint16_t) -(2*ITER_COUNT))
  234. TEST_RACE_OPERATION (uint16_sub_3, uint16_t, , -= 3, 0, (uint16_t) -(6*ITER_COUNT))
  235. TEST_RACE_OPERATION (uint16_postdec, uint16_t, , --, 0, (uint16_t) -(2*ITER_COUNT))
  236. TEST_RACE_OPERATION (uint16_predec, uint16_t, --, , 0, (uint16_t) -(2*ITER_COUNT))
  237. TEST_RACE_OPERATION (uint16_mul, uint16_t, , *= 3, 1, (uint16_t) 0x6D01)
  238. TEST_RACE_OPERATION (uint32_add, uint32_t, , += 1, 0, (uint32_t) (2*ITER_COUNT))
  239. TEST_RACE_OPERATION (uint32_add_3, uint32_t, , += 3, 0, (uint32_t) (6*ITER_COUNT))
  240. TEST_RACE_OPERATION (uint32_postinc, uint32_t, , ++, 0, (uint32_t) (2*ITER_COUNT))
  241. TEST_RACE_OPERATION (uint32_preinc, uint32_t, ++, , 0, (uint32_t) (2*ITER_COUNT))
  242. TEST_RACE_OPERATION (uint32_sub, uint32_t, , -= 1, 0, (uint32_t) -(2*ITER_COUNT))
  243. TEST_RACE_OPERATION (uint32_sub_3, uint32_t, , -= 3, 0, (uint32_t) -(6*ITER_COUNT))
  244. TEST_RACE_OPERATION (uint32_postdec, uint32_t, , --, 0, (uint32_t) -(2*ITER_COUNT))
  245. TEST_RACE_OPERATION (uint32_predec, uint32_t, --, , 0, (uint32_t) -(2*ITER_COUNT))
  246. TEST_RACE_OPERATION (uint32_mul, uint32_t, , *= 3, 1, (uint32_t) 0xC1E36D01U)
  247. TEST_RACE_OPERATION (uint64_add, uint64_t, , += 1, 0, (uint64_t) (2*ITER_COUNT))
  248. TEST_RACE_OPERATION (uint64_add_3, uint64_t, , += 3, 0, (uint64_t) (6*ITER_COUNT))
  249. TEST_RACE_OPERATION (uint64_add_neg, uint64_t, , += 1, -10000, (uint64_t) (2*ITER_COUNT-10000))
  250. TEST_RACE_OPERATION (uint64_postinc, uint64_t, , ++, 0, (uint64_t) (2*ITER_COUNT))
  251. TEST_RACE_OPERATION (uint64_postinc_neg, uint64_t, , ++, -10000, (uint64_t) (2*ITER_COUNT-10000))
  252. TEST_RACE_OPERATION (uint64_preinc, uint64_t, ++, , 0, (uint64_t) (2*ITER_COUNT))
  253. TEST_RACE_OPERATION (uint64_preinc_neg, uint64_t, ++, , -10000, (uint64_t) (2*ITER_COUNT-10000))
  254. TEST_RACE_OPERATION (uint64_sub, uint64_t, , -= 1, 0, (uint64_t) -(2*ITER_COUNT))
  255. TEST_RACE_OPERATION (uint64_sub_3, uint64_t, , -= 3, 0, (uint64_t) -(6*ITER_COUNT))
  256. TEST_RACE_OPERATION (uint64_sub_neg, uint64_t, , -= 1, 10000, (uint64_t) ((-2*ITER_COUNT)+10000))
  257. TEST_RACE_OPERATION (uint64_postdec, uint64_t, , --, 0, (uint64_t) -(2*ITER_COUNT))
  258. TEST_RACE_OPERATION (uint64_postdec_neg, uint64_t, , --, 10000, (uint64_t) ((-2*ITER_COUNT)+10000))
  259. TEST_RACE_OPERATION (uint64_predec, uint64_t, --, , 0, (uint64_t) -(2*ITER_COUNT))
  260. TEST_RACE_OPERATION (uint64_predec_neg, uint64_t, --, , 10000, (uint64_t) ((-2*ITER_COUNT)+10000))
  261. TEST_RACE_OPERATION (uint64_mul, uint64_t, , *= 3, 1, (uint64_t) 0x988EE974C1E36D01ULL)
  262. TEST_RACE_OPERATION (float_add, float, , += 1, 0, (2*ITER_COUNT))
  263. TEST_RACE_OPERATION (complex_float_add, _Complex float, , += 1, 0, (2*ITER_COUNT))
  264. TEST_RACE_OPERATION (float_postinc, float, , ++, 0, (2*ITER_COUNT))
  265. TEST_RACE_OPERATION (float_preinc, float, ++, , 0, (2*ITER_COUNT))
  266. TEST_RACE_OPERATION (float_sub, float, , -= 1, 0, -(2*ITER_COUNT))
  267. TEST_RACE_OPERATION (complex_float_sub, _Complex float, , -= 1, 0, -(2*ITER_COUNT))
  268. TEST_RACE_OPERATION (float_postdec, float, , --, 0, -(2*ITER_COUNT))
  269. TEST_RACE_OPERATION (float_predec, float, --, , 0, -(2*ITER_COUNT))
  270. TEST_RACE_OPERATION (double_add, double, , += 1, 0, (2*ITER_COUNT))
  271. TEST_RACE_OPERATION (complex_double_add, _Complex double, , += 1, 0, (2*ITER_COUNT))
  272. TEST_RACE_OPERATION (double_postinc, double, , ++, 0, (2*ITER_COUNT))
  273. TEST_RACE_OPERATION (double_preinc, double, ++, , 0, (2*ITER_COUNT))
  274. TEST_RACE_OPERATION (double_sub, double, , -= 1, 0, -(2*ITER_COUNT))
  275. TEST_RACE_OPERATION (complex_double_sub, _Complex double, , -= 1, 0, -(2*ITER_COUNT))
  276. TEST_RACE_OPERATION (double_postdec, double, , --, 0, -(2*ITER_COUNT))
  277. TEST_RACE_OPERATION (double_predec, double, --, , 0, -(2*ITER_COUNT))
  278. TEST_RACE_OPERATION (long_double_add, long double, , += 1, 0, (2*ITER_COUNT))
  279. TEST_RACE_OPERATION (complex_long_double_add, _Complex long double, , += 1, 0, (2*ITER_COUNT))
  280. TEST_RACE_OPERATION (long_double_postinc, long double, , ++, 0, (2*ITER_COUNT))
  281. TEST_RACE_OPERATION (long_double_sub, long double, , -= 1, 0, -(2*ITER_COUNT))
  282. TEST_RACE_OPERATION (long_double_preinc, long double, ++, , 0, (2*ITER_COUNT))
  283. TEST_RACE_OPERATION (complex_long_double_sub, _Complex long double, , -= 1, 0, -(2*ITER_COUNT))
  284. TEST_RACE_OPERATION (long_double_postdec, long double, , --, 0, -(2*ITER_COUNT))
  285. TEST_RACE_OPERATION (long_double_predec, long double, --, , 0, -(2*ITER_COUNT))
  286. TEST_GROUP_RUNNER(stdatomic)
  287. {
  288. RUN_TEST_CASE(stdatomic, test_64bit_atomics_fetch_op)
  289. RUN_TEST_CASE(stdatomic, test_32bit_atomics_fetch_op)
  290. RUN_TEST_CASE(stdatomic, test_16bit_atomics_fetch_op)
  291. RUN_TEST_CASE(stdatomic, test_8bit_atomics_fetch_op)
  292. #ifndef __clang__
  293. RUN_TEST_CASE(stdatomic, test_64bit_atomics_op_fetch)
  294. RUN_TEST_CASE(stdatomic, test_32bit_atomics_op_fetch)
  295. RUN_TEST_CASE(stdatomic, test_16bit_atomics_op_fetch)
  296. RUN_TEST_CASE(stdatomic, test_8bit_atomics_op_fetch)
  297. #endif
  298. RUN_TEST_CASE(stdatomic, test_64bit_exclusion)
  299. RUN_TEST_CASE(stdatomic, test_32bit_exclusion)
  300. RUN_TEST_CASE(stdatomic, test_16bit_exclusion)
  301. RUN_TEST_CASE(stdatomic, test_8bit_exclusion)
  302. RUN_TEST_CASE(stdatomic, test_uint8_add)
  303. RUN_TEST_CASE(stdatomic, test_uint8_add_3);
  304. RUN_TEST_CASE(stdatomic, test_uint8_postinc);
  305. RUN_TEST_CASE(stdatomic, test_uint8_preinc);
  306. RUN_TEST_CASE(stdatomic, test_uint8_sub);
  307. RUN_TEST_CASE(stdatomic, test_uint8_sub_3);
  308. RUN_TEST_CASE(stdatomic, test_uint8_postdec);
  309. RUN_TEST_CASE(stdatomic, test_uint8_predec);
  310. RUN_TEST_CASE(stdatomic, test_uint8_mul);
  311. RUN_TEST_CASE(stdatomic, test_uint16_add);
  312. RUN_TEST_CASE(stdatomic, test_uint16_add_3);
  313. RUN_TEST_CASE(stdatomic, test_uint16_postinc);
  314. RUN_TEST_CASE(stdatomic, test_uint16_preinc);
  315. RUN_TEST_CASE(stdatomic, test_uint16_sub);
  316. RUN_TEST_CASE(stdatomic, test_uint16_sub_3);
  317. RUN_TEST_CASE(stdatomic, test_uint16_postdec);
  318. RUN_TEST_CASE(stdatomic, test_uint16_predec);
  319. RUN_TEST_CASE(stdatomic, test_uint16_mul);
  320. RUN_TEST_CASE(stdatomic, test_uint32_add);
  321. RUN_TEST_CASE(stdatomic, test_uint32_add_3);
  322. RUN_TEST_CASE(stdatomic, test_uint32_postinc);
  323. RUN_TEST_CASE(stdatomic, test_uint32_preinc);
  324. RUN_TEST_CASE(stdatomic, test_uint32_sub);
  325. RUN_TEST_CASE(stdatomic, test_uint32_sub_3);
  326. RUN_TEST_CASE(stdatomic, test_uint32_postdec);
  327. RUN_TEST_CASE(stdatomic, test_uint32_predec);
  328. RUN_TEST_CASE(stdatomic, test_uint32_mul);
  329. RUN_TEST_CASE(stdatomic, test_uint64_add);
  330. RUN_TEST_CASE(stdatomic, test_uint64_add_3);
  331. RUN_TEST_CASE(stdatomic, test_uint64_add_neg);
  332. RUN_TEST_CASE(stdatomic, test_uint64_sub);
  333. RUN_TEST_CASE(stdatomic, test_uint64_sub_3);
  334. RUN_TEST_CASE(stdatomic, test_uint64_sub_neg);
  335. RUN_TEST_CASE(stdatomic, test_uint64_postinc);
  336. RUN_TEST_CASE(stdatomic, test_uint64_postinc_neg);
  337. RUN_TEST_CASE(stdatomic, test_uint64_preinc);
  338. RUN_TEST_CASE(stdatomic, test_uint64_preinc_neg);
  339. RUN_TEST_CASE(stdatomic, test_uint64_postdec);
  340. RUN_TEST_CASE(stdatomic, test_uint64_postdec_neg);
  341. RUN_TEST_CASE(stdatomic, test_uint64_predec);
  342. RUN_TEST_CASE(stdatomic, test_uint64_predec_neg);
  343. RUN_TEST_CASE(stdatomic, test_uint64_mul);
  344. RUN_TEST_CASE(stdatomic, test_float_add);
  345. RUN_TEST_CASE(stdatomic, test_complex_float_add);
  346. RUN_TEST_CASE(stdatomic, test_float_postinc);
  347. RUN_TEST_CASE(stdatomic, test_float_preinc);
  348. RUN_TEST_CASE(stdatomic, test_float_sub);
  349. RUN_TEST_CASE(stdatomic, test_complex_float_sub);
  350. RUN_TEST_CASE(stdatomic, test_float_postdec);
  351. RUN_TEST_CASE(stdatomic, test_float_predec);
  352. RUN_TEST_CASE(stdatomic, test_double_add);
  353. RUN_TEST_CASE(stdatomic, test_complex_double_add);
  354. RUN_TEST_CASE(stdatomic, test_double_postinc);
  355. RUN_TEST_CASE(stdatomic, test_double_preinc);
  356. RUN_TEST_CASE(stdatomic, test_double_sub);
  357. RUN_TEST_CASE(stdatomic, test_complex_double_sub);
  358. RUN_TEST_CASE(stdatomic, test_double_postdec);
  359. RUN_TEST_CASE(stdatomic, test_double_predec);
  360. RUN_TEST_CASE(stdatomic, test_long_double_add);
  361. RUN_TEST_CASE(stdatomic, test_complex_long_double_add);
  362. RUN_TEST_CASE(stdatomic, test_long_double_postinc);
  363. RUN_TEST_CASE(stdatomic, test_long_double_preinc);
  364. RUN_TEST_CASE(stdatomic, test_long_double_sub);
  365. RUN_TEST_CASE(stdatomic, test_complex_long_double_sub);
  366. RUN_TEST_CASE(stdatomic, test_long_double_postdec);
  367. RUN_TEST_CASE(stdatomic, test_long_double_predec);
  368. }