OSDN Git Service

[MIPS GlobalISel] Select global address
[android-x86/external-llvm.git] / test / CodeGen / Mips / GlobalISel / regbankselect / global_address.mir
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=regbankselect -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(i8*, ...)
9
10 ...
11 ---
12 name:            main
13 alignment:       2
14 legalized:       true
15 tracksRegLiveness: true
16 body:             |
17   bb.1.entry:
18     ; MIPS32-LABEL: name: main
19     ; MIPS32: [[GV:%[0-9]+]]:gprb(p0) = G_GLOBAL_VALUE @.str
20     ; MIPS32: [[COPY:%[0-9]+]]:gprb(p0) = COPY [[GV]](p0)
21     ; MIPS32: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1234567890
22     ; MIPS32: [[C1:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 0
23     ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
24     ; MIPS32: $a0 = COPY [[COPY]](p0)
25     ; MIPS32: $a1 = COPY [[C]](s32)
26     ; MIPS32: JAL @printf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $v0
27     ; MIPS32: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $v0
28     ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
29     ; MIPS32: $v0 = COPY [[C1]](s32)
30     ; MIPS32: RetRA implicit $v0
31     %2:_(p0) = G_GLOBAL_VALUE @.str
32     %1:_(p0) = COPY %2(p0)
33     %3:_(s32) = G_CONSTANT i32 1234567890
34     %4:_(s32) = G_CONSTANT i32 0
35     ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
36     $a0 = COPY %1(p0)
37     $a1 = COPY %3(s32)
38     JAL @printf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $v0
39     %0:_(s32) = COPY $v0
40     ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
41     $v0 = COPY %4(s32)
42     RetRA implicit $v0
43
44 ...