summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorZoran Jovanovic <zoran.jovanovic@imgtec.com>2016-04-13 16:02:25 +0000
committerZoran Jovanovic <zoran.jovanovic@imgtec.com>2016-04-13 16:02:25 +0000
commit2f6845ba3985b6758ae00615cdc307e55b4bcafc (patch)
tree03dda658ed823a330954b0851cd0790b34be5412 /llvm/test
parent3751d4114c8b5c8a0e78fb3d746123afc3758030 (diff)
downloadbcm5719-llvm-2f6845ba3985b6758ae00615cdc307e55b4bcafc.tar.gz
bcm5719-llvm-2f6845ba3985b6758ae00615cdc307e55b4bcafc.zip
[mips] Fix emitAtomicCmpSwapPartword to handle 64 bit pointers correctly
Differential Revision: http://reviews.llvm.org/D18995 llvm-svn: 266204
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/Mips/atomicCmpSwapPW.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/atomicCmpSwapPW.ll b/llvm/test/CodeGen/Mips/atomicCmpSwapPW.ll
new file mode 100644
index 00000000000..24ae673137a
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/atomicCmpSwapPW.ll
@@ -0,0 +1,17 @@
+; RUN: llc -O0 -march=mipsel -mcpu=mips32r2 -target-abi=o32 < %s -filetype=asm -o - \
+; RUN: | FileCheck -check-prefix=PTR32 -check-prefix=ALL %s
+; RUN: llc -O0 -march=mips64el -mcpu=mips64r2 -target-abi=n32 < %s -filetype=asm -o - \
+; RUN: | FileCheck -check-prefix=PTR32 -check-prefix=ALL %s
+; RUN: llc -O0 -march=mips64el -mcpu=mips64r2 -target-abi=n64 < %s -filetype=asm -o - \
+; RUN: | FileCheck -check-prefix=PTR64 -check-prefix=ALL %s
+
+; PTR32: lw $[[R0:[0-9]+]]
+; PTR64: ld $[[R0:[0-9]+]]
+
+; ALL: ll ${{[0-9]+}}, 0($[[R0]])
+
+define {i16, i1} @foo(i16* %addr, i16 signext %r, i16 zeroext %new) {
+ %res = cmpxchg i16* %addr, i16 %r, i16 %new seq_cst seq_cst
+ ret {i16, i1} %res
+}
+
OpenPOWER on IntegriCloud