• Home
  • Raw
  • Download

Lines Matching full:suffix

34 #define IMPL_TEST_ADD(suffix, dtype) \  argument
36 test_atomic_add_##suffix(PyObject *self, PyObject *obj) { \
38 assert(_Py_atomic_add_##suffix(&x, 1) == 0); \
40 assert(_Py_atomic_add_##suffix(&x, 2) == 1); \
42 assert(_Py_atomic_add_##suffix(&x, -2) == 3); \
44 assert(_Py_atomic_add_##suffix(&x, -1) == 1); \
46 assert(_Py_atomic_add_##suffix(&x, -1) == 0); \
48 assert(_Py_atomic_add_##suffix(&x, -2) == (dtype)-1); \
50 assert(_Py_atomic_add_##suffix(&x, 2) == (dtype)-3); \
56 #define IMPL_TEST_COMPARE_EXCHANGE(suffix, dtype) \ argument
58 test_atomic_compare_exchange_##suffix(PyObject *self, PyObject *obj) { \
62 assert(_Py_atomic_compare_exchange_##suffix(&x, &y, z) == 0); \
65 assert(_Py_atomic_compare_exchange_##suffix(&x, &y, z) == 1); \
68 assert(_Py_atomic_compare_exchange_##suffix(&x, &y, z) == 0); \
75 #define IMPL_TEST_EXCHANGE(suffix, dtype) \ in FOR_ALL_TYPES() argument
77 test_atomic_exchange_##suffix(PyObject *self, PyObject *obj) { \ in FOR_ALL_TYPES()
81 assert(_Py_atomic_exchange_##suffix(&x, y) == (dtype)0); \ in FOR_ALL_TYPES()
83 assert(_Py_atomic_exchange_##suffix(&x, z) == (dtype)1); \ in FOR_ALL_TYPES()
85 assert(_Py_atomic_exchange_##suffix(&x, y) == (dtype)2); \ in FOR_ALL_TYPES()
91 #define IMPL_TEST_LOAD_STORE(suffix, dtype) \ argument
93 test_atomic_load_store_##suffix(PyObject *self, PyObject *obj) { \
97 assert(_Py_atomic_load_##suffix(&x) == (dtype)0); \
99 _Py_atomic_store_##suffix(&x, y); \
100 assert(_Py_atomic_load_##suffix(&x) == (dtype)1); \
102 _Py_atomic_store_##suffix##_relaxed(&x, z); \
103 assert(_Py_atomic_load_##suffix##_relaxed(&x) == (dtype)2); \
109 #define IMPL_TEST_AND_OR(suffix, dtype) \ argument
111 test_atomic_and_or_##suffix(PyObject *self, PyObject *obj) { \
115 assert(_Py_atomic_or_##suffix(&x, z) == (dtype)0); \
117 assert(_Py_atomic_and_##suffix(&x, y) == (dtype)3); \
162 #define BIND_TEST_ADD(suffix, dtype) \ argument
163 {"test_atomic_add_" #suffix, test_atomic_add_##suffix, METH_NOARGS},
164 #define BIND_TEST_COMPARE_EXCHANGE(suffix, dtype) \ argument
165 {"test_atomic_compare_exchange_" #suffix, test_atomic_compare_exchange_##suffix, METH_NOARGS},
166 #define BIND_TEST_EXCHANGE(suffix, dtype) \ argument
167 {"test_atomic_exchange_" #suffix, test_atomic_exchange_##suffix, METH_NOARGS},
168 #define BIND_TEST_LOAD_STORE(suffix, dtype) \ argument
169 {"test_atomic_load_store_" #suffix, test_atomic_load_store_##suffix, METH_NOARGS},
170 #define BIND_TEST_AND_OR(suffix, dtype) \ argument
171 {"test_atomic_and_or_" #suffix, test_atomic_and_or_##suffix, METH_NOARGS},