1 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-none--eabi | FileCheck %s
2 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-none--eabi | FileCheck %s
3 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-openbsd | FileCheck %s
8 typedef enum memory_order
{
9 memory_order_relaxed
, memory_order_consume
, memory_order_acquire
,
10 memory_order_release
, memory_order_acq_rel
, memory_order_seq_cst
13 void test_presence(void)
15 // CHECK-LABEL: @test_presence
16 // CHECK: atomicrmw add ptr {{.*}} seq_cst, align 4
17 __atomic_fetch_add(&i
, 1, memory_order_seq_cst
);
18 // CHECK: atomicrmw sub ptr {{.*}} seq_cst, align 4
19 __atomic_fetch_sub(&i
, 1, memory_order_seq_cst
);
20 // CHECK: load atomic i32, ptr {{.*}} seq_cst, align 4
22 __atomic_load(&i
, &r
, memory_order_seq_cst
);
23 // CHECK: store atomic i32 {{.*}} seq_cst, align 4
25 __atomic_store(&i
, &r
, memory_order_seq_cst
);
27 // CHECK: atomicrmw add ptr {{.*}} seq_cst, align 8
28 __atomic_fetch_add(&l
, 1, memory_order_seq_cst
);
29 // CHECK: atomicrmw sub ptr {{.*}} seq_cst, align 8
30 __atomic_fetch_sub(&l
, 1, memory_order_seq_cst
);
31 // CHECK: load atomic i64, ptr {{.*}} seq_cst, align 8
33 __atomic_load(&l
, &rl
, memory_order_seq_cst
);
34 // CHECK: store atomic i64 {{.*}} seq_cst, align 8
36 __atomic_store(&l
, &rl
, memory_order_seq_cst
);