diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-13 06:31:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-13 06:31:38 +0000 |
commit | 51b92401c9f95023a2ef27064fd5a60fd99175f5 (patch) | |
tree | dd95389362087f96eea32f7885f751eeed874389 /test | |
parent | a1c4f7c833093f87d5187c4449a3d4534cfa40a4 (diff) |
Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
GNU __atomic builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/atomic-ops.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/atomic-ops.c b/test/CodeGen/atomic-ops.c index a8de19d1b5..1a9ed36ee2 100644 --- a/test/CodeGen/atomic-ops.c +++ b/test/CodeGen/atomic-ops.c @@ -74,6 +74,21 @@ int fi3b(int *i) { return __atomic_add_fetch(i, 1, memory_order_seq_cst); } +int fi3c(int *i) { + // CHECK: @fi3c + // CHECK: atomicrmw nand + // CHECK-NOT: and + return __atomic_fetch_nand(i, 1, memory_order_seq_cst); +} + +int fi3d(int *i) { + // CHECK: @fi3d + // CHECK: atomicrmw nand + // CHECK: and + // CHECK: xor + return __atomic_nand_fetch(i, 1, memory_order_seq_cst); +} + _Bool fi4(_Atomic(int) *i) { // CHECK: @fi4 // CHECK: cmpxchg i32* |