mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
51 lines
1.5 KiB
LLVM
51 lines
1.5 KiB
LLVM
; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=STATIC
|
|
; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DYNAMIC
|
|
; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=PIC
|
|
; RUN: llc < %s -mtriple=thumbv6-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=PIC_T
|
|
; RUN: llc < %s -mtriple=armv7-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=PIC_V7
|
|
; RUN: llc < %s -mtriple=armv6-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LINUX
|
|
|
|
@G = external global i32
|
|
|
|
define i32 @test1() {
|
|
; STATIC: _test1:
|
|
; STATIC: ldr r0, LCPI0_0
|
|
; STATIC: ldr r0, [r0]
|
|
; STATIC: .long _G
|
|
|
|
; DYNAMIC: _test1:
|
|
; DYNAMIC: ldr r0, LCPI0_0
|
|
; DYNAMIC: ldr r0, [r0]
|
|
; DYNAMIC: ldr r0, [r0]
|
|
; DYNAMIC: .long L_G$non_lazy_ptr
|
|
|
|
; PIC: _test1
|
|
; PIC: ldr r0, LCPI0_0
|
|
; PIC: ldr r0, [pc, r0]
|
|
; PIC: ldr r0, [r0]
|
|
; PIC: .long L_G$non_lazy_ptr-(LPC0_0+8)
|
|
|
|
; PIC_T: _test1
|
|
; PIC_T: ldr r0, LCPI0_0
|
|
; PIC_T: add r0, pc
|
|
; PIC_T: ldr r0, [r0]
|
|
; PIC_T: ldr r0, [r0]
|
|
; PIC_T: .long L_G$non_lazy_ptr-(LPC0_0+4)
|
|
|
|
; PIC_V7: _test1
|
|
; PIC_V7: movw r0, :lower16:(L_G$non_lazy_ptr-(LPC0_0+8))
|
|
; PIC_V7: movt r0, :upper16:(L_G$non_lazy_ptr-(LPC0_0+8))
|
|
; PIC_V7: ldr r0, [pc, r0]
|
|
; PIC_V7: ldr r0, [r0]
|
|
|
|
; LINUX: test1
|
|
; LINUX: ldr r0, .LCPI0_0
|
|
; LINUX: ldr r1, .LCPI0_1
|
|
; LINUX: add r0, pc, r0
|
|
; LINUX: ldr r0, [r1, r0]
|
|
; LINUX: ldr r0, [r0]
|
|
; LINUX: .long G(GOT)
|
|
%tmp = load i32, i32* @G
|
|
ret i32 %tmp
|
|
}
|