1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-29 23:12:55 +01:00
llvm-mirror/test/CodeGen/X86/atomic_add.ll
Stephen Lin 7e501cf4c3 Mass update to CodeGen tests to use CHECK-LABEL for labels corresponding to function definitions for more informative error messages. No functionality change and all updated tests passed locally.
This update was done with the following bash script:

  find test/CodeGen -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc.*debug" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_-]*\):\( *\)$FUNC: *\$/;\1\2-LABEL:\3$FUNC:/g" $TEMP
      done
      sed -i '' "s/;\(.*\)-LABEL-LABEL:/;\1-LABEL:/" $TEMP
      sed -i '' "s/;\(.*\)-NEXT-LABEL:/;\1-NEXT:/" $TEMP
      sed -i '' "s/;\(.*\)-NOT-LABEL:/;\1-NOT:/" $TEMP
      sed -i '' "s/;\(.*\)-DAG-LABEL:/;\1-DAG:/" $TEMP
      mv $TEMP $NAME
    fi
  done

llvm-svn: 186280
2013-07-14 06:24:09 +00:00

203 lines
4.0 KiB
LLVM

; RUN: llc < %s -march=x86-64 -verify-machineinstrs | FileCheck %s
; rdar://7103704
define void @sub1(i32* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: sub1:
; CHECK: subl
%0 = atomicrmw sub i32* %p, i32 %v monotonic
ret void
}
define void @inc4(i64* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: inc4:
; CHECK: incq
%0 = atomicrmw add i64* %p, i64 1 monotonic
ret void
}
define void @add8(i64* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: add8:
; CHECK: addq $2
%0 = atomicrmw add i64* %p, i64 2 monotonic
ret void
}
define void @add4(i64* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: add4:
; CHECK: addq
%0 = sext i32 %v to i64 ; <i64> [#uses=1]
%1 = atomicrmw add i64* %p, i64 %0 monotonic
ret void
}
define void @inc3(i8* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: inc3:
; CHECK: incb
%0 = atomicrmw add i8* %p, i8 1 monotonic
ret void
}
define void @add7(i8* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: add7:
; CHECK: addb $2
%0 = atomicrmw add i8* %p, i8 2 monotonic
ret void
}
define void @add3(i8* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: add3:
; CHECK: addb
%0 = trunc i32 %v to i8 ; <i8> [#uses=1]
%1 = atomicrmw add i8* %p, i8 %0 monotonic
ret void
}
define void @inc2(i16* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: inc2:
; CHECK: incw
%0 = atomicrmw add i16* %p, i16 1 monotonic
ret void
}
define void @add6(i16* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: add6:
; CHECK: addw $2
%0 = atomicrmw add i16* %p, i16 2 monotonic
ret void
}
define void @add2(i16* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: add2:
; CHECK: addw
%0 = trunc i32 %v to i16 ; <i16> [#uses=1]
%1 = atomicrmw add i16* %p, i16 %0 monotonic
ret void
}
define void @inc1(i32* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: inc1:
; CHECK: incl
%0 = atomicrmw add i32* %p, i32 1 monotonic
ret void
}
define void @add5(i32* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: add5:
; CHECK: addl $2
%0 = atomicrmw add i32* %p, i32 2 monotonic
ret void
}
define void @add1(i32* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: add1:
; CHECK: addl
%0 = atomicrmw add i32* %p, i32 %v monotonic
ret void
}
define void @dec4(i64* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: dec4:
; CHECK: decq
%0 = atomicrmw sub i64* %p, i64 1 monotonic
ret void
}
define void @sub8(i64* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: sub8:
; CHECK: subq $2
%0 = atomicrmw sub i64* %p, i64 2 monotonic
ret void
}
define void @sub4(i64* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: sub4:
; CHECK: subq
%0 = sext i32 %v to i64 ; <i64> [#uses=1]
%1 = atomicrmw sub i64* %p, i64 %0 monotonic
ret void
}
define void @dec3(i8* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: dec3:
; CHECK: decb
%0 = atomicrmw sub i8* %p, i8 1 monotonic
ret void
}
define void @sub7(i8* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: sub7:
; CHECK: subb $2
%0 = atomicrmw sub i8* %p, i8 2 monotonic
ret void
}
define void @sub3(i8* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: sub3:
; CHECK: subb
%0 = trunc i32 %v to i8 ; <i8> [#uses=1]
%1 = atomicrmw sub i8* %p, i8 %0 monotonic
ret void
}
define void @dec2(i16* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: dec2:
; CHECK: decw
%0 = atomicrmw sub i16* %p, i16 1 monotonic
ret void
}
define void @sub6(i16* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: sub6:
; CHECK: subw $2
%0 = atomicrmw sub i16* %p, i16 2 monotonic
ret void
}
define void @sub2(i16* nocapture %p, i32 %v) nounwind ssp {
entry:
; CHECK-LABEL: sub2:
; CHECK-NOT: negl
; CHECK: subw
%0 = trunc i32 %v to i16 ; <i16> [#uses=1]
%1 = atomicrmw sub i16* %p, i16 %0 monotonic
ret void
}
define void @dec1(i32* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: dec1:
; CHECK: decl
%0 = atomicrmw sub i32* %p, i32 1 monotonic
ret void
}
define void @sub5(i32* nocapture %p) nounwind ssp {
entry:
; CHECK-LABEL: sub5:
; CHECK: subl $2
%0 = atomicrmw sub i32* %p, i32 2 monotonic
ret void
}