Andrew Lenharth | f697ec3 | 2008-03-05 20:24:26 +0000 | [diff] [blame^] | 1 | // RUN: %llvmgcc %s -S -emit-llvm -o - | grep llvm.atomic |
Andrew Lenharth | 673d1bc | 2008-03-05 19:48:27 +0000 | [diff] [blame] | 2 | |
| 3 | int* foo(int** a, int* b, int* c) { |
| 4 | return __sync_val_compare_and_swap (a, b, c); |
| 5 | } |
| 6 | |
| 7 | int foo2(int** a, int* b, int* c) { |
| 8 | return __sync_bool_compare_and_swap (a, b, c); |
| 9 | } |
| 10 | |
| 11 | int* foo3(int** a, int b) { |
| 12 | return __sync_fetch_and_add (a, b); |
| 13 | } |
| 14 | |
| 15 | int* foo4(int** a, int b) { |
| 16 | return __sync_fetch_and_sub (a, b); |
| 17 | } |
| 18 | |
| 19 | int* foo5(int** a, int* b) { |
| 20 | return __sync_lock_test_and_set (a, b); |
| 21 | } |
| 22 | |
| 23 | int* foo6(int** a, int*** b) { |
| 24 | return __sync_lock_test_and_set (a, b); |
| 25 | } |