1 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv6m-none--eabi -target-cpu cortex-m0 | FileCheck %s
6 typedef enum memory_order
{
7 memory_order_relaxed
, memory_order_consume
, memory_order_acquire
,
8 memory_order_release
, memory_order_acq_rel
, memory_order_seq_cst
11 void test_presence(void)
13 // CHECK-LABEL: @test_presence
14 // CHECK: atomicrmw add ptr {{.*}} seq_cst, align 4
15 __atomic_fetch_add(&i
, 1, memory_order_seq_cst
);
16 // CHECK: atomicrmw sub {{.*}} seq_cst, align 4
17 __atomic_fetch_sub(&i
, 1, memory_order_seq_cst
);
18 // CHECK: load atomic i32, ptr {{.*}} seq_cst, align 4
20 __atomic_load(&i
, &r
, memory_order_seq_cst
);
21 // CHECK: store atomic i32 {{.*}}, ptr {{.*}} seq_cst, align 4
23 __atomic_store(&i
, &r
, memory_order_seq_cst
);
25 // CHECK: atomicrmw add {{.*}} seq_cst, align 8
26 __atomic_fetch_add(&l
, 1, memory_order_seq_cst
);
27 // CHECK: atomicrmw sub {{.*}} seq_cst, align 8
28 __atomic_fetch_sub(&l
, 1, memory_order_seq_cst
);
29 // CHECK: load atomic i64, ptr {{.*}} seq_cst, align 8
31 __atomic_load(&l
, &rl
, memory_order_seq_cst
);
32 // CHECK: store atomic i64 {{.*}}, ptr {{.*}} seq_cst, align 8
34 __atomic_store(&l
, &rl
, memory_order_seq_cst
);