mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 00:32:23 +00:00
8b2b8a1835
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186280 91177308-0d34-0410-b5e6-96231b3b80d8
62 lines
1.7 KiB
LLVM
62 lines
1.7 KiB
LLVM
; RUN: llc -mtriple=aarch64-none-linux-gnu -code-model=large < %s | FileCheck %s
|
|
|
|
@var8 = global i8 0
|
|
@var16 = global i16 0
|
|
@var32 = global i32 0
|
|
@var64 = global i64 0
|
|
|
|
define i8* @global_addr() {
|
|
; CHECK-LABEL: global_addr:
|
|
ret i8* @var8
|
|
; The movz/movk calculation should end up returned directly in x0.
|
|
; CHECK: movz x0, #:abs_g3:var8
|
|
; CHECK: movk x0, #:abs_g2_nc:var8
|
|
; CHECK: movk x0, #:abs_g1_nc:var8
|
|
; CHECK: movk x0, #:abs_g0_nc:var8
|
|
; CHECK-NEXT: ret
|
|
}
|
|
|
|
define i8 @global_i8() {
|
|
; CHECK-LABEL: global_i8:
|
|
%val = load i8* @var8
|
|
ret i8 %val
|
|
; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var8
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var8
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var8
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var8
|
|
; CHECK: ldrb w0, [x[[ADDR_REG]]]
|
|
}
|
|
|
|
define i16 @global_i16() {
|
|
; CHECK-LABEL: global_i16:
|
|
%val = load i16* @var16
|
|
ret i16 %val
|
|
; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var16
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var16
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var16
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var16
|
|
; CHECK: ldrh w0, [x[[ADDR_REG]]]
|
|
}
|
|
|
|
define i32 @global_i32() {
|
|
; CHECK-LABEL: global_i32:
|
|
%val = load i32* @var32
|
|
ret i32 %val
|
|
; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var32
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var32
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var32
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var32
|
|
; CHECK: ldr w0, [x[[ADDR_REG]]]
|
|
}
|
|
|
|
define i64 @global_i64() {
|
|
; CHECK-LABEL: global_i64:
|
|
%val = load i64* @var64
|
|
ret i64 %val
|
|
; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var64
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var64
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var64
|
|
; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var64
|
|
; CHECK: ldr x0, [x[[ADDR_REG]]]
|
|
}
|