Fix a FIXME. _foo.eh symbols are currently always exported so that the linker
[oota-llvm.git] / test / CodeGen / X86 / 2010-01-08-Atomic64Bug.ll
1 ; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s
2 ; rdar://r7512579
3
4 ; PHI defs in the atomic loop should be used by the add / adc
5 ; instructions. They should not be dead.
6
7 define void @t(i64* nocapture %p) nounwind ssp {
8 entry:
9 ; CHECK: t:
10 ; CHECK: movl $1
11 ; CHECK: movl (%ebp), %eax
12 ; CHECK: movl 4(%ebp), %edx
13 ; CHECK: LBB0_1:
14 ; CHECK-NOT: movl $1
15 ; CHECK-NOT: movl $0
16 ; CHECK: addl
17 ; CHECK: adcl
18 ; CHECK: lock
19 ; CHECK: cmpxchg8b
20 ; CHECK: jne
21   tail call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 true)
22   %0 = tail call i64 @llvm.atomic.load.add.i64.p0i64(i64* %p, i64 1) ; <i64> [#uses=0]
23   tail call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 true)
24   ret void
25 }
26
27 declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind
28
29 declare i64 @llvm.atomic.load.add.i64.p0i64(i64* nocapture, i64) nounwind