cpython/Modules/_testcapi/pyatomic.c

/*
 * C Extension module to smoke test pyatomic.h API.
 *
 * This only tests basic functionality, not any synchronizing ordering.
 */

#include "parts.h"

// We define atomic bitwise operations on these types
#define FOR_BITWISE_TYPES(V)

// We define atomic addition on these types
#define FOR_ARITHMETIC_TYPES(V)

// We define atomic load, store, exchange, and compare_exchange on these types
#define FOR_ALL_TYPES(V)

#define IMPL_TEST_ADD(suffix, dtype)
FOR_ARITHMETIC_TYPES()

#define IMPL_TEST_COMPARE_EXCHANGE(suffix, dtype)
FOR_ALL_TYPES()

#define IMPL_TEST_EXCHANGE(suffix, dtype)
FOR_ALL_TYPES()

#define IMPL_TEST_LOAD_STORE(suffix, dtype)
FOR_ALL_TYPES()

#define IMPL_TEST_AND_OR(suffix, dtype)
FOR_BITWISE_TYPES()

static PyObject *
test_atomic_fences(PyObject *self, PyObject *obj) {}

static PyObject *
test_atomic_release_acquire(PyObject *self, PyObject *obj) {}

static PyObject *
test_atomic_load_store_int_release_acquire(PyObject *self, PyObject *obj) {}

// NOTE: all tests should start with "test_atomic_" to be included
// in test_pyatomic.py

#define BIND_TEST_ADD(suffix, dtype)
#define BIND_TEST_COMPARE_EXCHANGE(suffix, dtype)
#define BIND_TEST_EXCHANGE(suffix, dtype)
#define BIND_TEST_LOAD_STORE(suffix, dtype)
#define BIND_TEST_AND_OR(suffix, dtype)

static PyMethodDef test_methods[] =;

int
_PyTestCapi_Init_PyAtomic(PyObject *mod)
{}