Andrew Lenharth | f697ec3 | 2008-03-05 20:24:26 +0000 | [diff] [blame] | 1 | // RUN: %llvmgcc %s -S -emit-llvm -o - | grep llvm.atomic |
Dan Gohman | d2cb3d2 | 2009-07-24 00:30:09 +0000 | [diff] [blame^] | 2 | // XFAIL: sparc-sun-solaris2|arm |
Dale Johannesen | e31d874 | 2008-05-15 22:22:37 +0000 | [diff] [blame] | 3 | // Feature currently implemented only for x86, alpha, powerpc. |
Andrew Lenharth | 673d1bc | 2008-03-05 19:48:27 +0000 | [diff] [blame] | 4 | |
| 5 | int* foo(int** a, int* b, int* c) { |
| 6 | return __sync_val_compare_and_swap (a, b, c); |
| 7 | } |
| 8 | |
| 9 | int foo2(int** a, int* b, int* c) { |
| 10 | return __sync_bool_compare_and_swap (a, b, c); |
| 11 | } |
| 12 | |
| 13 | int* foo3(int** a, int b) { |
| 14 | return __sync_fetch_and_add (a, b); |
| 15 | } |
| 16 | |
| 17 | int* foo4(int** a, int b) { |
| 18 | return __sync_fetch_and_sub (a, b); |
| 19 | } |
| 20 | |
| 21 | int* foo5(int** a, int* b) { |
| 22 | return __sync_lock_test_and_set (a, b); |
| 23 | } |
| 24 | |
| 25 | int* foo6(int** a, int*** b) { |
| 26 | return __sync_lock_test_and_set (a, b); |
| 27 | } |