test_atomics.c revision ab8beedeb70c6941e0ff68014d8db64cee4ef15d
1#include <stdio.h> 2 3 4extern int __atomic_dec(volatile int* addr); 5 6int main(int argc, const char *argv[]) 7{ 8 int x = 5; 9 10 while (x > -20) { 11 printf("old_x=%d\n", __atomic_dec(&x)); 12 printf("x=%d\n", x); 13 } 14 15 printf ("OK\n"); 16 return 0; 17} 18