diff --git a/tests/features/S2N_ATOMIC_SUPPORTED.c b/tests/features/S2N_ATOMIC_SUPPORTED.c index d371aaee3a4..e9244361f4c 100644 --- a/tests/features/S2N_ATOMIC_SUPPORTED.c +++ b/tests/features/S2N_ATOMIC_SUPPORTED.c @@ -14,10 +14,17 @@ */ #include +#include int main() { + /* Atomic builtins are supported by gcc 4.7.3 and later. */ sig_atomic_t atomic = 0; __atomic_test_and_set(&atomic, __ATOMIC_RELAXED); __atomic_clear(&atomic, __ATOMIC_RELAXED); + + /* _Static_assert is supported for C99 by gcc 4.6 and later, + * so using it here shouldn't limit use of the atomic builtins. */ + _Static_assert(__atomic_always_lock_free(sizeof(sig_atomic_t), NULL), + "Atomic operations in this environment would require locking"); return 0; }