2011-07-07 05:55:05 +02:00
|
|
|
; 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
|
2007-01-19 10:20:23 +01:00
|
|
|
|
2007-05-04 02:29:34 +02:00
|
|
|
@G = external global i32
|
2007-01-19 10:20:23 +01:00
|
|
|
|
2007-05-04 02:29:34 +02:00
|
|
|
define i32 @test1() {
|
|
|
|
%tmp = load i32* @G
|
|
|
|
ret i32 %tmp
|
2007-01-19 10:20:23 +01:00
|
|
|
}
|
2009-10-19 20:27:56 +02:00
|
|
|
|
|
|
|
; DarwinStatic: _test1:
|
2010-04-17 18:29:15 +02:00
|
|
|
; DarwinStatic: ldr r0, LCPI0_0
|
2009-10-19 20:27:56 +02:00
|
|
|
; DarwinStatic: ldr r0, [r0]
|
|
|
|
; DarwinStatic: bx lr
|
|
|
|
|
|
|
|
; DarwinStatic: .align 2
|
2010-04-17 18:29:15 +02:00
|
|
|
; DarwinStatic: LCPI0_0:
|
2009-10-19 20:27:56 +02:00
|
|
|
; DarwinStatic: .long {{_G$}}
|
|
|
|
|
|
|
|
|
|
|
|
; DarwinDynamic: _test1:
|
2010-04-17 18:29:15 +02:00
|
|
|
; DarwinDynamic: ldr r0, LCPI0_0
|
2009-10-19 20:27:56 +02:00
|
|
|
; DarwinDynamic: ldr r0, [r0]
|
|
|
|
; DarwinDynamic: ldr r0, [r0]
|
|
|
|
; DarwinDynamic: bx lr
|
|
|
|
|
|
|
|
; DarwinDynamic: .align 2
|
2010-04-17 18:29:15 +02:00
|
|
|
; DarwinDynamic: LCPI0_0:
|
2009-10-19 20:27:56 +02:00
|
|
|
; 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:
|
2010-04-17 18:29:15 +02:00
|
|
|
; DarwinPIC: ldr r0, LCPI0_0
|
|
|
|
; DarwinPIC: LPC0_0:
|
2010-03-17 18:52:21 +01:00
|
|
|
; DarwinPIC: ldr r0, [pc, r0]
|
2009-10-19 20:27:56 +02:00
|
|
|
; DarwinPIC: ldr r0, [r0]
|
|
|
|
; DarwinPIC: bx lr
|
|
|
|
|
|
|
|
; DarwinPIC: .align 2
|
2010-04-17 18:29:15 +02:00
|
|
|
; DarwinPIC: LCPI0_0:
|
|
|
|
; DarwinPIC: .long L_G$non_lazy_ptr-(LPC0_0+8)
|
2009-10-19 20:27:56 +02:00
|
|
|
|
|
|
|
; 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
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; LinuxPIC-LABEL: test1:
|
2010-04-17 18:29:15 +02:00
|
|
|
; LinuxPIC: ldr r0, .LCPI0_0
|
|
|
|
; LinuxPIC: ldr r1, .LCPI0_1
|
2009-10-19 20:27:56 +02:00
|
|
|
|
2010-04-17 18:29:15 +02:00
|
|
|
; LinuxPIC: .LPC0_0:
|
2009-10-19 20:27:56 +02:00
|
|
|
; LinuxPIC: add r0, pc, r0
|
2010-03-17 18:52:21 +01:00
|
|
|
; LinuxPIC: ldr r0, [r1, r0]
|
2009-10-19 20:27:56 +02:00
|
|
|
; LinuxPIC: ldr r0, [r0]
|
|
|
|
; LinuxPIC: bx lr
|
|
|
|
|
2010-01-26 21:21:43 +01:00
|
|
|
; LinuxPIC: .align 2
|
2010-04-17 18:29:15 +02:00
|
|
|
; LinuxPIC: .LCPI0_0:
|
|
|
|
; LinuxPIC: .long _GLOBAL_OFFSET_TABLE_-(.LPC0_0+8)
|
|
|
|
; LinuxPIC: .LCPI0_1:
|
2009-10-19 20:27:56 +02:00
|
|
|
; LinuxPIC: .long G(GOT)
|