From 4d78cb54f60eac305d4b7e9e1ff90bb968634756 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 23 Sep 2009 20:00:58 -0400 Subject: [PATCH] test_atomic: test for byte/short atomic support Signed-off-by: Mathieu Desnoyers --- tests/test_atomic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_atomic.c b/tests/test_atomic.c index 102012f..585c8ca 100644 --- a/tests/test_atomic.c +++ b/tests/test_atomic.c @@ -2,9 +2,18 @@ #include #include +#if (defined(__i386__) || defined(__x86_64__)) +#define HAS_ATOMIC_BYTE +#define HAS_ATOMIC_SHORT +#endif + struct testvals { +#ifdef HAS_ATOMIC_BYTE unsigned char c; +#endif +#ifdef HAS_ATOMIC_SHORT unsigned short s; +#endif unsigned int i; unsigned long l; }; @@ -43,8 +52,12 @@ do { \ int main(int argc, char **argv) { +#ifdef HAS_ATOMIC_BYTE do_test(&vals.c); +#endif +#ifdef HAS_ATOMIC_SHORT do_test(&vals.s); +#endif do_test(&vals.i); do_test(&vals.l); printf("Atomic ops test OK\n"); -- 2.34.1