blob: 03aedab9524ec46932fd1ec6b0ce842f083c0ee4 [file] [log] [blame]
Andrew Lenharthf697ec32008-03-05 20:24:26 +00001// RUN: %llvmgcc %s -S -emit-llvm -o - | grep llvm.atomic
Dale Johannesene31d8742008-05-15 22:22:37 +00002// XFAIL: sparc-sun-solaris2|arm|ia64
3// Feature currently implemented only for x86, alpha, powerpc.
Andrew Lenharth673d1bc2008-03-05 19:48:27 +00004
5int* foo(int** a, int* b, int* c) {
6return __sync_val_compare_and_swap (a, b, c);
7}
8
9int foo2(int** a, int* b, int* c) {
10return __sync_bool_compare_and_swap (a, b, c);
11}
12
13int* foo3(int** a, int b) {
14 return __sync_fetch_and_add (a, b);
15}
16
17int* foo4(int** a, int b) {
18 return __sync_fetch_and_sub (a, b);
19}
20
21int* foo5(int** a, int* b) {
22 return __sync_lock_test_and_set (a, b);
23}
24
25int* foo6(int** a, int*** b) {
26 return __sync_lock_test_and_set (a, b);
27}