1# RUN: llc -O0 -mtriple arm-linux -relocation-model=static -mattr=+no-movt -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,ELF-NOMOVT 2# RUN: llc -O0 -mtriple arm-linux -relocation-model=static -mattr=-no-movt,+v8m -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,ELF-MOVT 3# RUN: llc -O0 -mtriple arm-darwin -relocation-model=static -mattr=+no-movt -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,DARWIN-NOMOVT 4# RUN: llc -O0 -mtriple arm-darwin -relocation-model=static -mattr=-no-movt,+v8m -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,DARWIN-MOVT 5--- | 6 @internal_global = internal global i32 42 7 define void @test_internal_global() { ret void } 8 9 @external_global = external global i32 10 define void @test_external_global() { ret void } 11... 12--- 13name: test_internal_global 14# CHECK-LABEL: name: test_internal_global 15legalized: true 16regBankSelected: true 17selected: false 18# CHECK: selected: true 19registers: 20 - { id: 0, class: gprb } 21 - { id: 1, class: gprb } 22# ELF-NOMOVT: constants: 23# ELF-NOMOVT: id: 0 24# ELF-NOMOVT: value: 'i32* @internal_global' 25body: | 26 bb.0: 27 %0(p0) = G_GLOBAL_VALUE @internal_global 28 ; ELF-MOVT: [[G:%[0-9]+]]:gpr = MOVi32imm @internal_global 29 ; ELF-NOMOVT: [[G:%[0-9]+]]:gpr = LDRi12 %const.0, 0, 14 /* CC::al */, $noreg :: (load 4 from constant-pool) 30 ; DARWIN-MOVT: [[G:%[0-9]+]]:gpr = MOVi32imm @internal_global 31 ; DARWIN-NOMOVT: [[G:%[0-9]+]]:gpr = LDRLIT_ga_abs @internal_global 32 33 %1(s32) = G_LOAD %0(p0) :: (load 4 from @internal_global) 34 ; CHECK: [[V:%[0-9]+]]:gpr = LDRi12 [[G]], 0, 14 /* CC::al */, $noreg 35 36 $r0 = COPY %1(s32) 37 ; CHECK: $r0 = COPY [[V]] 38 39 BX_RET 14, $noreg, implicit $r0 40 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0 41... 42--- 43name: test_external_global 44# CHECK-LABEL: name: test_external_global 45legalized: true 46regBankSelected: true 47selected: false 48# CHECK: selected: true 49registers: 50 - { id: 0, class: gprb } 51 - { id: 1, class: gprb } 52# ELF-NOMOVT: constants: 53# ELF-NOMOVT: id: 0 54# ELF-NOMOVT: value: 'i32* @external_global' 55body: | 56 bb.0: 57 %0(p0) = G_GLOBAL_VALUE @external_global 58 ; ELF-MOVT: [[G:%[0-9]+]]:gpr = MOVi32imm @external_global 59 ; ELF-NOMOVT: [[G:%[0-9]+]]:gpr = LDRi12 %const.0, 0, 14 /* CC::al */, $noreg :: (load 4 from constant-pool) 60 ; DARWIN-MOVT: [[G:%[0-9]+]]:gpr = MOVi32imm @external_global 61 ; DARWIN-NOMOVT: [[G:%[0-9]+]]:gpr = LDRLIT_ga_abs @external_global 62 63 %1(s32) = G_LOAD %0(p0) :: (load 4 from @external_global) 64 ; CHECK: [[V:%[0-9]+]]:gpr = LDRi12 [[G]], 0, 14 /* CC::al */, $noreg 65 66 $r0 = COPY %1(s32) 67 ; CHECK: $r0 = COPY [[V]] 68 69 BX_RET 14, $noreg, implicit $r0 70 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0 71... 72