llvm/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-global-rv64.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - | FileCheck %s

--- |
  @var = global i32 0

  define ptr @test_global() {
    ret ptr @var
  }

...
---
name:            test_global
alignment:       4
tracksRegLiveness: true
registers:
  - { id: 0, class: _ }
frameInfo:
  maxAlignment:    1
machineFunctionInfo:
  varArgsFrameIndex: 0
  varArgsSaveSize: 0
body:             |
  bb.1 (%ir-block.0):
    ; CHECK-LABEL: name: test_global
    ; CHECK: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @var
    ; CHECK-NEXT: $x10 = COPY [[GV]](p0)
    ; CHECK-NEXT: PseudoRET implicit $x10
    %0:_(p0) = G_GLOBAL_VALUE @var
    $x10 = COPY %0(p0)
    PseudoRET implicit $x10

...