brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · f04e648 Raw
61 lines · plain
1; RUN: llc -mtriple=mipsel -relocation-model=pic < %s | FileCheck %s2 3@data = global [8193 x i32] zeroinitializer4 5define void @R(ptr %p) nounwind {6entry:7  ; CHECK-LABEL: R:8 9  call void asm sideeffect "lw $$1, $0", "*R,~{$1}"(ptr elementtype(i32) @data)10 11  ; CHECK: lw $[[BASEPTR:[0-9]+]], %got(data)(12  ; CHECK: #APP13  ; CHECK: lw $1, 0($[[BASEPTR]])14  ; CHECK: #NO_APP15 16  ret void17}18 19define void @R_offset_4(ptr %p) nounwind {20entry:21  ; CHECK-LABEL: R_offset_4:22 23  call void asm sideeffect "lw $$1, $0", "*R,~{$1}"(ptr elementtype(i32) getelementptr inbounds ([8193 x i32], ptr @data, i32 0, i32 1))24 25  ; CHECK: lw $[[BASEPTR:[0-9]+]], %got(data)(26  ; CHECK: #APP27  ; CHECK: lw $1, 4($[[BASEPTR]])28  ; CHECK: #NO_APP29 30  ret void31}32 33define void @R_offset_254(ptr %p) nounwind {34entry:35  ; CHECK-LABEL: R_offset_254:36 37  call void asm sideeffect "lw $$1, $0", "*R,~{$1}"(ptr elementtype(i32) getelementptr inbounds ([8193 x i32], ptr @data, i32 0, i32 63))38 39  ; CHECK-DAG: lw $[[BASEPTR:[0-9]+]], %got(data)(40  ; CHECK: #APP41  ; CHECK: lw $1, 252($[[BASEPTR]])42  ; CHECK: #NO_APP43 44  ret void45}46 47define void @R_offset_256(ptr %p) nounwind {48entry:49  ; CHECK-LABEL: R_offset_256:50 51  call void asm sideeffect "lw $$1, $0", "*R,~{$1}"(ptr elementtype(i32) getelementptr inbounds ([8193 x i32], ptr @data, i32 0, i32 64))52 53  ; CHECK-DAG: lw $[[BASEPTR:[0-9]+]], %got(data)(54  ; CHECK: addiu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], 25655  ; CHECK: #APP56  ; CHECK: lw $1, 0($[[BASEPTR2]])57  ; CHECK: #NO_APP58 59  ret void60}61