| Index: crosstest/test_sync_atomic.cpp
|
| diff --git a/crosstest/test_sync_atomic.cpp b/crosstest/test_sync_atomic.cpp
|
| index 9cfb9635acd00bcca44d8f6f3fb0f40ed9d1c5e5..d1578ebc3de85a4edd0d4433ff6d68083e571ac2 100644
|
| --- a/crosstest/test_sync_atomic.cpp
|
| +++ b/crosstest/test_sync_atomic.cpp
|
| @@ -19,36 +19,36 @@
|
|
|
| #include "test_sync_atomic.h"
|
|
|
| -#define X(inst, type) \
|
| - type test_##inst(bool fetch_first, volatile type *ptr, type a) { \
|
| - if (fetch_first) { \
|
| - return __sync_fetch_and_##inst(ptr, a); \
|
| - } else { \
|
| - return __sync_##inst##_and_fetch(ptr, a); \
|
| - } \
|
| - } \
|
| - type test_alloca_##inst(bool fetch, volatile type *ptr, type a) { \
|
| - const size_t buf_size = 8; \
|
| - type buf[buf_size]; \
|
| - for (size_t i = 0; i < buf_size; ++i) { \
|
| - if (fetch) { \
|
| - buf[i] = __sync_fetch_and_##inst(ptr, a); \
|
| - } else { \
|
| - buf[i] = __sync_##inst##_and_fetch(ptr, a); \
|
| - } \
|
| - } \
|
| - type sum = 0; \
|
| - for (size_t i = 0; i < buf_size; ++i) { \
|
| - sum += buf[i]; \
|
| - } \
|
| - return sum; \
|
| - } \
|
| - type test_const_##inst(bool fetch, volatile type *ptr, type ign) { \
|
| - if (fetch) { \
|
| - return __sync_fetch_and_##inst(ptr, 42); \
|
| - } else { \
|
| - return __sync_##inst##_and_fetch(ptr, 99); \
|
| - } \
|
| +#define X(inst, type) \
|
| + type test_##inst(bool fetch_first, volatile type *ptr, type a) { \
|
| + if (fetch_first) { \
|
| + return __sync_fetch_and_##inst(ptr, a); \
|
| + } else { \
|
| + return __sync_##inst##_and_fetch(ptr, a); \
|
| + } \
|
| + } \
|
| + type test_alloca_##inst(bool fetch, volatile type *ptr, type a) { \
|
| + const size_t buf_size = 8; \
|
| + type buf[buf_size]; \
|
| + for (size_t i = 0; i < buf_size; ++i) { \
|
| + if (fetch) { \
|
| + buf[i] = __sync_fetch_and_##inst(ptr, a); \
|
| + } else { \
|
| + buf[i] = __sync_##inst##_and_fetch(ptr, a); \
|
| + } \
|
| + } \
|
| + type sum = 0; \
|
| + for (size_t i = 0; i < buf_size; ++i) { \
|
| + sum += buf[i]; \
|
| + } \
|
| + return sum; \
|
| + } \
|
| + type test_const_##inst(bool fetch, volatile type *ptr, type ign) { \
|
| + if (fetch) { \
|
| + return __sync_fetch_and_##inst(ptr, 42); \
|
| + } else { \
|
| + return __sync_##inst##_and_fetch(ptr, 99); \
|
| + } \
|
| }
|
|
|
| FOR_ALL_RMWOP_TYPES(X)
|
|
|