projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
urcu-ht: fix
[urcu.git]
/
tests
/
test_atomic.c
diff --git
a/tests/test_atomic.c
b/tests/test_atomic.c
index 102012fe2429008cf28f9736ec1b074f7fa00c8f..585c8ca86fbca43597dabd2d2a68569173479c4e 100644
(file)
--- a/
tests/test_atomic.c
+++ b/
tests/test_atomic.c
@@
-2,9
+2,18
@@
#include <arch_atomic.h>
#include <assert.h>
#include <arch_atomic.h>
#include <assert.h>
+#if (defined(__i386__) || defined(__x86_64__))
+#define HAS_ATOMIC_BYTE
+#define HAS_ATOMIC_SHORT
+#endif
+
struct testvals {
struct testvals {
+#ifdef HAS_ATOMIC_BYTE
unsigned char c;
unsigned char c;
+#endif
+#ifdef HAS_ATOMIC_SHORT
unsigned short s;
unsigned short s;
+#endif
unsigned int i;
unsigned long l;
};
unsigned int i;
unsigned long l;
};
@@
-43,8
+52,12
@@
do { \
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
+#ifdef HAS_ATOMIC_BYTE
do_test(&vals.c);
do_test(&vals.c);
+#endif
+#ifdef HAS_ATOMIC_SHORT
do_test(&vals.s);
do_test(&vals.s);
+#endif
do_test(&vals.i);
do_test(&vals.l);
printf("Atomic ops test OK\n");
do_test(&vals.i);
do_test(&vals.l);
printf("Atomic ops test OK\n");
This page took
0.026812 seconds
and
4
git commands to generate.