1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test/CodeGen/X86/2010-10-08-cmpxchg8b.ll
Matthias Braun f7935a3f63 X86: Do not use llc -march in tests.
`llc -march` is problematic because it only switches the target
architecture, but leaves the operating system unchanged. This
occasionally leads to indeterministic tests because the OS from
LLVM_DEFAULT_TARGET_TRIPLE is used.

However we can simply always use `llc -mtriple` instead. This changes
all the tests to do this to avoid people using -march when they copy and
paste parts of tests.

See also the discussion in https://reviews.llvm.org/D35287

llvm-svn: 309774
2017-08-02 00:28:10 +00:00

27 lines
902 B
LLVM

; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s
; PR8297
;
; On i386, i64 cmpxchg is lowered during legalize types to extract the
; 64-bit result into a pair of fixed regs. So creation of the DAG node
; happens in a different place. See
; X86TargetLowering::ReplaceNodeResults, case ATOMIC_CMP_SWAP.
;
; Neither Atomic-xx.ll nor atomic_op.ll cover this. Those tests were
; autogenerated from C source before 64-bit variants were supported.
;
; Note that this case requires a loop around the cmpxchg to force
; machine licm to query alias anlysis, exposing a bad
; MachineMemOperand.
define void @foo(i64* %ptr) nounwind inlinehint {
entry:
br label %loop
loop:
; CHECK: lock cmpxchg8b
%pair = cmpxchg i64* %ptr, i64 0, i64 1 monotonic monotonic
%r = extractvalue { i64, i1 } %pair, 0
%stored1 = icmp eq i64 %r, 0
br i1 %stored1, label %loop, label %continue
continue:
ret void
}