summaryrefslogtreecommitdiff
path: root/test/CodeGen/XCore/atomic.ll
diff options
context:
space:
mode:
authorRobert Lytton <robert@xmos.com>2013-11-12 10:11:26 +0000
committerRobert Lytton <robert@xmos.com>2013-11-12 10:11:26 +0000
commit32e8528c3368d5e0986cb265b436799cc490ea0c (patch)
treedb91eca62ea74e7333238360b8342865d89ce151 /test/CodeGen/XCore/atomic.ll
parentc17ea93ed516d5c7d03a8d5c7fc470a0f254b58a (diff)
downloadllvm-32e8528c3368d5e0986cb265b436799cc490ea0c.tar.gz
llvm-32e8528c3368d5e0986cb265b436799cc490ea0c.tar.bz2
llvm-32e8528c3368d5e0986cb265b436799cc490ea0c.tar.xz
Add XCore support for ATOMIC_FENCE.
ATOMIC_FENCE is lowered to a compiler barrier which is codegen only. There is no need to emit an instructions since the XCore provides sequential consistency. Original patch by Richard Osborne git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/XCore/atomic.ll')
-rw-r--r--test/CodeGen/XCore/atomic.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/atomic.ll b/test/CodeGen/XCore/atomic.ll
new file mode 100644
index 0000000000..95fca9ac5b
--- /dev/null
+++ b/test/CodeGen/XCore/atomic.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s -march=xcore | FileCheck %s
+
+; CHECK-LABEL: atomic_fence
+; CHECK: #MEMBARRIER
+; CHECK: #MEMBARRIER
+; CHECK: #MEMBARRIER
+; CHECK: #MEMBARRIER
+; CHECK: retsp 0
+define void @atomic_fence() nounwind {
+entry:
+ fence acquire
+ fence release
+ fence acq_rel
+ fence seq_cst
+ ret void
+}