brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · a03fe25 Raw
43 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -O0 -run-pass=legalizer --relocation-model=pic %s -o - | FileCheck %s --check-prefix=PIC3 4--- |5  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"6  target triple = "aarch64--"7  @var = external global i88  define ptr @test_global() { ret ptr undef }9  define ptr @test_global_with_offset() { ret ptr undef }10...11---12name:            test_global13registers:14  - { id: 0, class: _ }15body: |16  bb.0:17 18    ; We don't want to lower to G_ADD_LOW when we need a GOT access, or when the code19    ; model isn't 'Small'.20 21    ; PIC-LABEL: name: test_global22    ; PIC: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @var23    ; PIC-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[GV]](p0)24    ; PIC-NEXT: $x0 = COPY [[PTRTOINT]](s64)25    %0(p0) = G_GLOBAL_VALUE @var26    %1:_(s64) = G_PTRTOINT %027    $x0 = COPY %128...29---30name:            test_global_with_offset31registers:32  - { id: 0, class: _ }33body: |34  bb.0:35    ; PIC-LABEL: name: test_global_with_offset36    ; PIC: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @var + 137    ; PIC-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[GV]](p0)38    ; PIC-NEXT: $x0 = COPY [[PTRTOINT]](s64)39    %0(p0) = G_GLOBAL_VALUE @var + 140    %1:_(s64) = G_PTRTOINT %041    $x0 = COPY %142...43