[Sparc][LEON] Unit test for CASA instruction supported by some LEON processors added.
authorChris Dewhurst <chris.dewhurst@lero.ie>
Fri, 9 Sep 2016 09:08:13 +0000 (09:08 +0000)
committerChris Dewhurst <chris.dewhurst@lero.ie>
Fri, 9 Sep 2016 09:08:13 +0000 (09:08 +0000)
llvm-svn: 281021

llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll [new file with mode: 0755]

diff --git a/llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll b/llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll
new file mode 100755 (executable)
index 0000000..0d41f31
--- /dev/null
@@ -0,0 +1,14 @@
+; RUN: llc %s -O0 -march=sparc -mcpu=leon3 -mattr=+hasleoncasa -o - | FileCheck %s
+; RUN: llc %s -O0 -march=sparc -mcpu=gr712rc -o - | FileCheck %s
+; RUN: llc %s -O0 -march=sparc -mcpu=leon4 -o - | FileCheck %s
+; RUN: llc %s -O0 -march=sparc -mcpu=gr740 -o - | FileCheck %s
+
+; CHECK-LABEL: casa_test
+; CHECK:       casa [%o0] 10, %o3, %o2
+define void @casa_test(i32* %ptr) {
+  %pair = cmpxchg i32* %ptr, i32 0, i32 1 monotonic monotonic
+  %r = extractvalue { i32, i1 } %pair, 0
+  %stored1  = icmp eq i32 %r, 0
+
+  ret void
+}