mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 16:31:16 +00:00
cf2ab764db
All changes were made by the following bash script: find test/CodeGen -name "*.ll" | \ while read NAME; do echo "$NAME" grep -q "^; *RUN: *llc.*debug" $NAME && continue grep -q "^; *RUN:.*llvm-objdump" $NAME && continue grep -q "^; *RUN: *opt.*" $NAME && continue 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_-]*\)\([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 done This script catches a superset of the cases caught by the script associated with commit r186280. It initially found some false positives due to unusual constructs in a minority of tests; all such cases were disambiguated first in commit r186621. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186624 91177308-0d34-0410-b5e6-96231b3b80d8
46 lines
1.2 KiB
LLVM
46 lines
1.2 KiB
LLVM
; RUN: llc < %s -mcpu=atom -mtriple=i686-linux | FileCheck -check-prefix=ATOM32 %s
|
|
; RUN: llc < %s -mcpu=core2 -mtriple=i686-linux | FileCheck -check-prefix=ATOM-NOT32 %s
|
|
; RUN: llc < %s -mcpu=atom -mtriple=x86_64-linux | FileCheck -check-prefix=ATOM64 %s
|
|
; RUN: llc < %s -mcpu=core2 -mtriple=x86_64-linux | FileCheck -check-prefix=ATOM-NOT64 %s
|
|
|
|
|
|
; fn_ptr.ll
|
|
%class.A = type { i32 (...)** }
|
|
|
|
define i32 @test1() #0 {
|
|
;ATOM-LABEL: test1:
|
|
entry:
|
|
%call = tail call %class.A* @_Z3facv()
|
|
%0 = bitcast %class.A* %call to void (%class.A*)***
|
|
%vtable = load void (%class.A*)*** %0, align 8
|
|
%1 = load void (%class.A*)** %vtable, align 8
|
|
;ATOM32: movl (%ecx), %ecx
|
|
;ATOM32: calll *%ecx
|
|
;ATOM-NOT32: calll *(%ecx)
|
|
;ATOM64: movq (%rcx), %rcx
|
|
;ATOM64: callq *%rcx
|
|
;ATOM-NOT64: callq *(%rcx)
|
|
tail call void %1(%class.A* %call)
|
|
ret i32 0
|
|
}
|
|
|
|
declare %class.A* @_Z3facv() #1
|
|
|
|
; virt_fn.ll
|
|
@p = external global void (i32)**
|
|
|
|
define i32 @test2() #0 {
|
|
;ATOM-LABEL: test2:
|
|
entry:
|
|
%0 = load void (i32)*** @p, align 8
|
|
%1 = load void (i32)** %0, align 8
|
|
;ATOM32: movl (%eax), %eax
|
|
;ATOM32: calll *%eax
|
|
;ATOM-NOT: calll *(%eax)
|
|
;ATOM64: movq (%rax), %rax
|
|
;ATOM64: callq *%rax
|
|
;ATOM-NOT64: callq *(%rax)
|
|
tail call void %1(i32 2)
|
|
ret i32 0
|
|
}
|