1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -relocation-model=pic -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32_PIC
4 declare i32 @f(i32 %a, i32 %b);
6 define internal i32 @f_with_local_linkage(i32 %x, i32 %y) {
7 ; MIPS32_PIC-LABEL: name: f_with_local_linkage
8 ; MIPS32_PIC: bb.1.entry:
9 ; MIPS32_PIC: liveins: $a0, $a1
10 ; MIPS32_PIC: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
11 ; MIPS32_PIC: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
12 ; MIPS32_PIC: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY]]
13 ; MIPS32_PIC: $v0 = COPY [[ADD]](s32)
14 ; MIPS32_PIC: RetRA implicit $v0
20 define i32 @call_global(i32 %a, i32 %b) {
21 ; MIPS32_PIC-LABEL: name: call_global
22 ; MIPS32_PIC: bb.1.entry:
23 ; MIPS32_PIC: liveins: $a0, $a1, $t9, $v0
24 ; MIPS32_PIC: [[ADDu:%[0-9]+]]:gpr32 = ADDu $v0, $t9
25 ; MIPS32_PIC: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
26 ; MIPS32_PIC: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
27 ; MIPS32_PIC: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
28 ; MIPS32_PIC: [[GV:%[0-9]+]]:gpr32(p0) = G_GLOBAL_VALUE target-flags(mips-got-call) @f
29 ; MIPS32_PIC: $a0 = COPY [[COPY]](s32)
30 ; MIPS32_PIC: $a1 = COPY [[COPY1]](s32)
31 ; MIPS32_PIC: $gp = COPY [[ADDu]]
32 ; MIPS32_PIC: JALRPseudo [[GV]](p0), csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $gp, implicit-def $v0
33 ; MIPS32_PIC: [[COPY2:%[0-9]+]]:_(s32) = COPY $v0
34 ; MIPS32_PIC: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
35 ; MIPS32_PIC: $v0 = COPY [[COPY2]](s32)
36 ; MIPS32_PIC: RetRA implicit $v0
38 %call = call i32 @f(i32 %a, i32 %b)
42 define i32 @call_global_with_local_linkage(i32 %a, i32 %b) {
43 ; MIPS32_PIC-LABEL: name: call_global_with_local_linkage
44 ; MIPS32_PIC: bb.1.entry:
45 ; MIPS32_PIC: liveins: $a0, $a1, $t9, $v0
46 ; MIPS32_PIC: [[ADDu:%[0-9]+]]:gpr32 = ADDu $v0, $t9
47 ; MIPS32_PIC: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
48 ; MIPS32_PIC: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
49 ; MIPS32_PIC: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
50 ; MIPS32_PIC: [[GV:%[0-9]+]]:gpr32(p0) = G_GLOBAL_VALUE @f_with_local_linkage
51 ; MIPS32_PIC: $a0 = COPY [[COPY]](s32)
52 ; MIPS32_PIC: $a1 = COPY [[COPY1]](s32)
53 ; MIPS32_PIC: $gp = COPY [[ADDu]]
54 ; MIPS32_PIC: JALRPseudo [[GV]](p0), csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $gp, implicit-def $v0
55 ; MIPS32_PIC: [[COPY2:%[0-9]+]]:_(s32) = COPY $v0
56 ; MIPS32_PIC: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
57 ; MIPS32_PIC: $v0 = COPY [[COPY2]](s32)
58 ; MIPS32_PIC: RetRA implicit $v0
60 %call = call i32 @f_with_local_linkage(i32 %a, i32 %b)