initial import
[ICEs.git] / bfin-boost-sync-fetch / test.i
1 int main(int argc, char *argv[]) {
2 char *c = &argc;
3 short *s = &argc;
4 int *i = &argc;
5 long long *l = &argc;
6 return
7 __sync_fetch_and_add(c, -1) +
8 __sync_fetch_and_add(s, -1) +
9 __sync_fetch_and_add(i, -1) +
10 __sync_fetch_and_add(l, -1) +
11 __sync_val_compare_and_swap(c, argc, argc + 1) +
12 __sync_val_compare_and_swap(s, argc, argc + 1) +
13 __sync_val_compare_and_swap(i, argc, argc + 1) +
14 __sync_val_compare_and_swap(l, argc, argc + 1);
15 }