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
76 lines
2.0 KiB
LLVM
76 lines
2.0 KiB
LLVM
; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=DarwinStatic
|
|
; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DarwinDynamic
|
|
; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=DarwinPIC
|
|
; RUN: llc < %s -mtriple=armv6-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LinuxPIC
|
|
|
|
@G = external global i32
|
|
|
|
define i32 @test1() {
|
|
%tmp = load i32, i32* @G
|
|
ret i32 %tmp
|
|
}
|
|
|
|
; DarwinStatic: _test1:
|
|
; DarwinStatic: ldr r0, LCPI0_0
|
|
; DarwinStatic: ldr r0, [r0]
|
|
; DarwinStatic: bx lr
|
|
|
|
; DarwinStatic: .align 2
|
|
; DarwinStatic: LCPI0_0:
|
|
; DarwinStatic: .long {{_G$}}
|
|
|
|
|
|
; DarwinDynamic: _test1:
|
|
; DarwinDynamic: ldr r0, LCPI0_0
|
|
; DarwinDynamic: ldr r0, [r0]
|
|
; DarwinDynamic: ldr r0, [r0]
|
|
; DarwinDynamic: bx lr
|
|
|
|
; DarwinDynamic: .align 2
|
|
; DarwinDynamic: LCPI0_0:
|
|
; DarwinDynamic: .long L_G$non_lazy_ptr
|
|
|
|
; DarwinDynamic: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
|
|
; DarwinDynamic: .align 2
|
|
; DarwinDynamic: L_G$non_lazy_ptr:
|
|
; DarwinDynamic: .indirect_symbol _G
|
|
; DarwinDynamic: .long 0
|
|
|
|
|
|
|
|
; DarwinPIC: _test1:
|
|
; DarwinPIC: ldr r0, LCPI0_0
|
|
; DarwinPIC: LPC0_0:
|
|
; DarwinPIC: ldr r0, [pc, r0]
|
|
; DarwinPIC: ldr r0, [r0]
|
|
; DarwinPIC-NOT: ldr
|
|
; DarwinPIC: bx lr
|
|
|
|
; DarwinPIC: .align 2
|
|
; DarwinPIC: LCPI0_0:
|
|
; DarwinPIC: .long L_G$non_lazy_ptr-(LPC0_0+8)
|
|
|
|
; DarwinPIC: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
|
|
; DarwinPIC: .align 2
|
|
; DarwinPIC: L_G$non_lazy_ptr:
|
|
; DarwinPIC: .indirect_symbol _G
|
|
; DarwinPIC: .long 0
|
|
|
|
|
|
|
|
; LinuxPIC-LABEL: test1:
|
|
; LinuxPIC: ldr r0, .LCPI0_0
|
|
; LinuxPIC: ldr r1, .LCPI0_1
|
|
|
|
; LinuxPIC: .LPC0_0:
|
|
; LinuxPIC: add r0, pc, r0
|
|
; LinuxPIC: ldr r0, [r1, r0]
|
|
; LinuxPIC: ldr r0, [r0]
|
|
; LinuxPIC: bx lr
|
|
|
|
; LinuxPIC: .align 2
|
|
; LinuxPIC: .LCPI0_0:
|
|
; LinuxPIC: .long _GLOBAL_OFFSET_TABLE_-(.LPC0_0+8)
|
|
; LinuxPIC: .LCPI0_1:
|
|
; LinuxPIC: .long G(GOT)
|