[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / arm-atomics-m0.c
blob94e344cf608df42128b474ff3d0347f9dcf3bc4e
1 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv6m-none--eabi -target-cpu cortex-m0 | FileCheck %s
3 int i;
4 long long l;
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
9 } memory_order;
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
19 int r;
20 __atomic_load(&i, &r, memory_order_seq_cst);
21 // CHECK: store atomic i32 {{.*}}, ptr {{.*}} seq_cst, align 4
22 r = 0;
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
30 long long rl;
31 __atomic_load(&l, &rl, memory_order_seq_cst);
32 // CHECK: store atomic i64 {{.*}}, ptr {{.*}} seq_cst, align 8
33 rl = 0;
34 __atomic_store(&l, &rl, memory_order_seq_cst);