From ddad6e028ec3f348fab624988d6ad1d4c1316f3e Mon Sep 17 00:00:00 2001 From: Chris Dewhurst Date: Fri, 9 Sep 2016 09:08:13 +0000 Subject: [PATCH] [Sparc][LEON] Unit test for CASA instruction supported by some LEON processors added. llvm-svn: 281021 --- llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll diff --git a/llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll b/llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll new file mode 100755 index 0000000..0d41f31 --- /dev/null +++ b/llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll @@ -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 +} -- 2.7.4