[PowerPC] Add tests to reflect cfence on float point types. NFC.
authorKai Luo <gluokai@gmail.com>
Sat, 11 Jun 2022 04:10:21 +0000 (12:10 +0800)
committerKai Luo <gluokai@gmail.com>
Sat, 11 Jun 2022 04:30:15 +0000 (12:30 +0800)
llvm/test/CodeGen/PowerPC/cfence-double.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/cfence-float.ll [new file with mode: 0644]

diff --git a/llvm/test/CodeGen/PowerPC/cfence-double.ll b/llvm/test/CodeGen/PowerPC/cfence-double.ll
new file mode 100644 (file)
index 0000000..72c1a33
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: not --crash llc -opaque-pointers -mtriple=powerpc64le-unknown-unknown \
+; RUN:   < %s 2>&1 | FileCheck %s
+; RUN: not --crash llc -opaque-pointers -mtriple=powerpc64-unknown-unknown \
+; RUN:   < %s 2>&1 | FileCheck %s
+
+; CHECK: Intrinsic has incorrect argument type!
+; CHECK: ptr @llvm.ppc.cfence.f64
+define void @foo() {
+entry:
+  %0 = load atomic double, double* undef acquire, align 8
+  ret void
+}
diff --git a/llvm/test/CodeGen/PowerPC/cfence-float.ll b/llvm/test/CodeGen/PowerPC/cfence-float.ll
new file mode 100644 (file)
index 0000000..71d2864
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: not --crash llc -opaque-pointers -mtriple=powerpc64le-unknown-unknown \
+; RUN:   < %s 2>&1 | FileCheck %s
+; RUN: not --crash llc -opaque-pointers -mtriple=powerpc64-unknown-unknown \
+; RUN:   < %s 2>&1 | FileCheck %s
+
+; CHECK: Intrinsic has incorrect argument type!
+; CHECK: ptr @llvm.ppc.cfence.f32
+define void @bar() {
+entry:
+  %0 = load atomic float, float* undef acquire, align 8
+  ret void
+}