summaryrefslogtreecommitdiffstats
path: root/llvm/test/Assembler
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Assembler')
-rw-r--r--llvm/test/Assembler/atomic.ll10
-rw-r--r--llvm/test/Assembler/invalid-atomicrmw-fadd-must-be-fp-type.ll7
-rw-r--r--llvm/test/Assembler/invalid-atomicrmw-fsub-must-be-fp-type.ll7
3 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Assembler/atomic.ll b/llvm/test/Assembler/atomic.ll
index a8b527f2f86..04ff262074f 100644
--- a/llvm/test/Assembler/atomic.ll
+++ b/llvm/test/Assembler/atomic.ll
@@ -39,3 +39,13 @@ define void @f(i32* %x) {
fence syncscope("device") seq_cst
ret void
}
+
+define void @fp_atomics(float* %x) {
+ ; CHECK: atomicrmw fadd float* %x, float 1.000000e+00 seq_cst
+ atomicrmw fadd float* %x, float 1.0 seq_cst
+
+ ; CHECK: atomicrmw volatile fadd float* %x, float 1.000000e+00 seq_cst
+ atomicrmw volatile fadd float* %x, float 1.0 seq_cst
+
+ ret void
+}
diff --git a/llvm/test/Assembler/invalid-atomicrmw-fadd-must-be-fp-type.ll b/llvm/test/Assembler/invalid-atomicrmw-fadd-must-be-fp-type.ll
new file mode 100644
index 00000000000..3185d9505db
--- /dev/null
+++ b/llvm/test/Assembler/invalid-atomicrmw-fadd-must-be-fp-type.ll
@@ -0,0 +1,7 @@
+; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
+
+; CHECK: error: atomicrmw fadd operand must be a floating point type
+define void @f(i32* %ptr) {
+ atomicrmw fadd i32* %ptr, i32 2 seq_cst
+ ret void
+}
diff --git a/llvm/test/Assembler/invalid-atomicrmw-fsub-must-be-fp-type.ll b/llvm/test/Assembler/invalid-atomicrmw-fsub-must-be-fp-type.ll
new file mode 100644
index 00000000000..cd5bd4beff5
--- /dev/null
+++ b/llvm/test/Assembler/invalid-atomicrmw-fsub-must-be-fp-type.ll
@@ -0,0 +1,7 @@
+; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
+
+; CHECK: error: atomicrmw fsub operand must be a floating point type
+define void @f(i32* %ptr) {
+ atomicrmw fsub i32* %ptr, i32 2 seq_cst
+ ret void
+}
OpenPOWER on IntegriCloud