Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / fp-atomic-ops.c
blobc894e7b4ade373a5a4b69100652bdf8b557a16ab
1 // RUN: %clang_cc1 %s -emit-llvm -DDOUBLE -O0 -o - -triple=amdgcn-amd-amdhsa \
2 // RUN: | FileCheck -check-prefixes=FLOAT,DOUBLE %s
4 // RUN: %clang_cc1 %s -emit-llvm -DDOUBLE -O0 -o - -triple=aarch64-linux-gnu \
5 // RUN: | FileCheck -check-prefixes=FLOAT,DOUBLE %s
7 // RUN: %clang_cc1 %s -emit-llvm -O0 -o - -triple=armv8-apple-ios7.0 \
8 // RUN: | FileCheck -check-prefixes=FLOAT %s
10 // RUN: %clang_cc1 %s -emit-llvm -DDOUBLE -O0 -o - -triple=hexagon \
11 // RUN: | FileCheck -check-prefixes=FLOAT,DOUBLE %s
13 // RUN: %clang_cc1 %s -emit-llvm -DDOUBLE -O0 -o - -triple=mips64-mti-linux-gnu \
14 // RUN: | FileCheck -check-prefixes=FLOAT,DOUBLE %s
16 // RUN: %clang_cc1 %s -emit-llvm -O0 -o - -triple=i686-linux-gnu \
17 // RUN: | FileCheck -check-prefixes=FLOAT %s
19 // RUN: %clang_cc1 %s -emit-llvm -DDOUBLE -O0 -o - -triple=x86_64-linux-gnu \
20 // RUN: | FileCheck -check-prefixes=FLOAT,DOUBLE %s
22 typedef enum memory_order {
23 memory_order_relaxed = __ATOMIC_RELAXED,
24 memory_order_acquire = __ATOMIC_ACQUIRE,
25 memory_order_release = __ATOMIC_RELEASE,
26 memory_order_acq_rel = __ATOMIC_ACQ_REL,
27 memory_order_seq_cst = __ATOMIC_SEQ_CST
28 } memory_order;
30 void test(float *f, float ff, double *d, double dd) {
31 // FLOAT: atomicrmw fadd ptr {{.*}} monotonic
32 __atomic_fetch_add(f, ff, memory_order_relaxed);
34 // FLOAT: atomicrmw fsub ptr {{.*}} monotonic
35 __atomic_fetch_sub(f, ff, memory_order_relaxed);
37 #ifdef DOUBLE
38 // DOUBLE: atomicrmw fadd ptr {{.*}} monotonic
39 __atomic_fetch_add(d, dd, memory_order_relaxed);
41 // DOUBLE: atomicrmw fsub ptr {{.*}} monotonic
42 __atomic_fetch_sub(d, dd, memory_order_relaxed);
43 #endif