From: Mathieu Desnoyers Date: Thu, 24 Sep 2009 00:00:58 +0000 (-0400) Subject: test_atomic: test for byte/short atomic support X-Git-Tag: v0.1~36 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4d78cb54f60eac305d4b7e9e1ff90bb968634756;p=userspace-rcu.git test_atomic: test for byte/short atomic support Signed-off-by: Mathieu Desnoyers --- 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");