2 #include <arch_atomic.h>
12 static struct testvals vals
;
14 #define do_test(ptr) \
18 atomic_add(ptr, 10); \
20 atomic_add(ptr, -11); \
21 assert(*ptr == (__typeof__(*ptr))-1U); \
22 v = cmpxchg(ptr, -1, 22); \
24 assert(v == (__typeof__(*ptr))-1U); \
25 v = cmpxchg(ptr, 33, 44); \
33 int main(int argc
, char **argv
)
39 printf("Atomic ops test OK\n");
This page took 0.031896 seconds and 5 git commands to generate.