brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 356c5f4 Raw
62 lines · plain
1; RUN: llc -mtriple=mipsel -relocation-model=pic < %s | FileCheck %s2 3@data = global [8193 x i32] zeroinitializer4 5define void @o(ptr %p) nounwind {6entry:7  ; CHECK-LABEL: o:8 9  call void asm sideeffect "lw $$1, $0", "*o,~{$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 @o_offset_4(ptr %p) nounwind {20entry:21  ; CHECK-LABEL: o_offset_4:22 23  call void asm sideeffect "lw $$1, $0", "*o,~{$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 @o_offset_32764(ptr %p) nounwind {34entry:35  ; CHECK-LABEL: o_offset_32764:36 37  call void asm sideeffect "lw $$1, $0", "*o,~{$1}"(ptr elementtype(i32) getelementptr inbounds ([8193 x i32], ptr @data, i32 0, i32 8191))38 39  ; CHECK-DAG: lw $[[BASEPTR:[0-9]+]], %got(data)(40  ; CHECK: #APP41  ; CHECK: lw $1, 32764($[[BASEPTR]])42  ; CHECK: #NO_APP43 44  ret void45}46 47define void @o_offset_32768(ptr %p) nounwind {48entry:49  ; CHECK-LABEL: o_offset_32768:50 51  call void asm sideeffect "lw $$1, $0", "*o,~{$1}"(ptr elementtype(i32) getelementptr inbounds ([8193 x i32], ptr @data, i32 0, i32 8192))52 53  ; CHECK-DAG: lw $[[BASEPTR:[0-9]+]], %got(data)(54  ; CHECK-DAG: ori $[[T0:[0-9]+]], $zero, 3276855  ; CHECK: addu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], $[[T0]]56  ; CHECK: #APP57  ; CHECK: lw $1, 0($[[BASEPTR2]])58  ; CHECK: #NO_APP59 60  ret void61}62