xref: /llvm-project/llvm/test/CodeGen/Mips/GlobalISel/instruction-select/gloal_address.mir (revision 60442f0d442723a487528bdd8b48b24657a025e8)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
3--- |
4
5  @.str = private unnamed_addr constant [11 x i8] c"hello %d \0A\00"
6
7  define void @main() {entry: ret void}
8  declare i32 @printf(ptr, ...)
9
10...
11---
12name:            main
13alignment:       4
14legalized:       true
15regBankSelected: true
16tracksRegLiveness: true
17body:             |
18  bb.1.entry:
19    ; MIPS32-LABEL: name: main
20    ; MIPS32: [[LUi:%[0-9]+]]:gpr32 = LUi target-flags(mips-abs-hi) @.str
21    ; MIPS32: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu [[LUi]], target-flags(mips-abs-lo) @.str
22    ; MIPS32: [[LUi1:%[0-9]+]]:gpr32 = LUi 18838
23    ; MIPS32: [[ORi:%[0-9]+]]:gpr32 = ORi [[LUi1]], 722
24    ; MIPS32: [[ORi1:%[0-9]+]]:gpr32 = ORi $zero, 0
25    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
26    ; MIPS32: $a0 = COPY [[ADDiu]]
27    ; MIPS32: $a1 = COPY [[ORi]]
28    ; MIPS32: JAL @printf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $v0
29    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
30    ; MIPS32: $v0 = COPY [[ORi1]]
31    ; MIPS32: RetRA implicit $v0
32    %2:gprb(p0) = G_GLOBAL_VALUE @.str
33    %1:gprb(p0) = COPY %2(p0)
34    %3:gprb(s32) = G_CONSTANT i32 1234567890
35    %4:gprb(s32) = G_CONSTANT i32 0
36    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
37    $a0 = COPY %1(p0)
38    $a1 = COPY %3(s32)
39    JAL @printf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $v0
40    %0:gprb(s32) = COPY $v0
41    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
42    $v0 = COPY %4(s32)
43    RetRA implicit $v0
44
45...
46