• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc  < %s -mtriple=mips-mti-linux-gnu -relocation-model=static \
3; RUN:   -mips-tail-calls=1 -mcpu=mips32r2 -mattr=+use-indirect-jump-hazard \
4; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=MIPS32R2
5; RUN: llc  < %s -mtriple=mips-img-linux-gnu -relocation-model=static \
6; RUN:   -mips-tail-calls=1 -mcpu=mips32r6 -mattr=+use-indirect-jump-hazard \
7; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=MIPS32R6
8; RUN: llc  < %s -mtriple=mips64-mti-linux-gnu -relocation-model=static \
9; RUN:   -mips-tail-calls=1 -mcpu=mips64r2 -mattr=+use-indirect-jump-hazard \
10; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=MIPS64R2
11; RUN: llc  < %s -mtriple=mips64-img-linux-gnu -relocation-model=static \
12; RUN:   -mips-tail-calls=1 -mcpu=mips64r6 -mattr=+use-indirect-jump-hazard \
13; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=MIPS64R6
14
15; RUN: llc  < %s -mtriple=mips-mti-linux-gnu -relocation-model=pic \
16; RUN:   -mips-tail-calls=1 -mcpu=mips32r2 -mattr=+use-indirect-jump-hazard \
17; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS32R2
18; RUN: llc  < %s -mtriple=mips-img-linux-gnu -relocation-model=pic \
19; RUN:   -mips-tail-calls=1 -mcpu=mips32r6 -mattr=+use-indirect-jump-hazard \
20; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS32R6
21; RUN: llc  < %s -mtriple=mips64-mti-linux-gnu -relocation-model=pic \
22; RUN:   -mips-tail-calls=1 -mcpu=mips64r2 -mattr=+use-indirect-jump-hazard \
23; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS64R2
24; RUN: llc  < %s -mtriple=mips64-img-linux-gnu -relocation-model=pic \
25; RUN:   -mips-tail-calls=1 -mcpu=mips64r6 -mattr=+use-indirect-jump-hazard \
26; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS64R6
27
28@.str = private unnamed_addr constant [2 x i8] c"A\00", align 1
29@.str.1 = private unnamed_addr constant [2 x i8] c"B\00", align 1
30@.str.2 = private unnamed_addr constant [2 x i8] c"C\00", align 1
31@.str.3 = private unnamed_addr constant [2 x i8] c"D\00", align 1
32@.str.4 = private unnamed_addr constant [2 x i8] c"E\00", align 1
33@.str.5 = private unnamed_addr constant [2 x i8] c"F\00", align 1
34@.str.6 = private unnamed_addr constant [2 x i8] c"G\00", align 1
35@.str.7 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
36
37define i8* @_Z3fooi(i32 signext %Letter) {
38; MIPS32R2-LABEL: _Z3fooi:
39; MIPS32R2:       # %bb.0: # %entry
40; MIPS32R2-NEXT:    addiu $sp, $sp, -16
41; MIPS32R2-NEXT:    .cfi_def_cfa_offset 16
42; MIPS32R2-NEXT:    sltiu $1, $4, 7
43; MIPS32R2-NEXT:    beqz $1, $BB0_3
44; MIPS32R2-NEXT:    sw $4, 4($sp)
45; MIPS32R2-NEXT:  $BB0_1: # %entry
46; MIPS32R2-NEXT:    sll $1, $4, 2
47; MIPS32R2-NEXT:    lui $2, %hi($JTI0_0)
48; MIPS32R2-NEXT:    addu $1, $1, $2
49; MIPS32R2-NEXT:    lw $1, %lo($JTI0_0)($1)
50; MIPS32R2-NEXT:    jr.hb $1
51; MIPS32R2-NEXT:    nop
52; MIPS32R2-NEXT:  $BB0_2: # %sw.bb
53; MIPS32R2-NEXT:    lui $1, %hi($.str)
54; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str)
55; MIPS32R2-NEXT:    j $BB0_10
56; MIPS32R2-NEXT:    sw $1, 8($sp)
57; MIPS32R2-NEXT:  $BB0_3: # %sw.epilog
58; MIPS32R2-NEXT:    lui $1, %hi($.str.7)
59; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.7)
60; MIPS32R2-NEXT:    j $BB0_10
61; MIPS32R2-NEXT:    sw $1, 8($sp)
62; MIPS32R2-NEXT:  $BB0_4: # %sw.bb1
63; MIPS32R2-NEXT:    lui $1, %hi($.str.1)
64; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.1)
65; MIPS32R2-NEXT:    j $BB0_10
66; MIPS32R2-NEXT:    sw $1, 8($sp)
67; MIPS32R2-NEXT:  $BB0_5: # %sw.bb2
68; MIPS32R2-NEXT:    lui $1, %hi($.str.2)
69; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.2)
70; MIPS32R2-NEXT:    j $BB0_10
71; MIPS32R2-NEXT:    sw $1, 8($sp)
72; MIPS32R2-NEXT:  $BB0_6: # %sw.bb3
73; MIPS32R2-NEXT:    lui $1, %hi($.str.3)
74; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.3)
75; MIPS32R2-NEXT:    j $BB0_10
76; MIPS32R2-NEXT:    sw $1, 8($sp)
77; MIPS32R2-NEXT:  $BB0_7: # %sw.bb4
78; MIPS32R2-NEXT:    lui $1, %hi($.str.4)
79; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.4)
80; MIPS32R2-NEXT:    j $BB0_10
81; MIPS32R2-NEXT:    sw $1, 8($sp)
82; MIPS32R2-NEXT:  $BB0_8: # %sw.bb5
83; MIPS32R2-NEXT:    lui $1, %hi($.str.5)
84; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.5)
85; MIPS32R2-NEXT:    j $BB0_10
86; MIPS32R2-NEXT:    sw $1, 8($sp)
87; MIPS32R2-NEXT:  $BB0_9: # %sw.bb6
88; MIPS32R2-NEXT:    lui $1, %hi($.str.6)
89; MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.6)
90; MIPS32R2-NEXT:    sw $1, 8($sp)
91; MIPS32R2-NEXT:  $BB0_10: # %return
92; MIPS32R2-NEXT:    lw $2, 8($sp)
93; MIPS32R2-NEXT:    jr $ra
94; MIPS32R2-NEXT:    addiu $sp, $sp, 16
95;
96; MIPS32R6-LABEL: _Z3fooi:
97; MIPS32R6:       # %bb.0: # %entry
98; MIPS32R6-NEXT:    addiu $sp, $sp, -16
99; MIPS32R6-NEXT:    .cfi_def_cfa_offset 16
100; MIPS32R6-NEXT:    sltiu $1, $4, 7
101; MIPS32R6-NEXT:    beqz $1, $BB0_3
102; MIPS32R6-NEXT:    sw $4, 4($sp)
103; MIPS32R6-NEXT:  $BB0_1: # %entry
104; MIPS32R6-NEXT:    sll $1, $4, 2
105; MIPS32R6-NEXT:    lui $2, %hi($JTI0_0)
106; MIPS32R6-NEXT:    addu $1, $1, $2
107; MIPS32R6-NEXT:    lw $1, %lo($JTI0_0)($1)
108; MIPS32R6-NEXT:    jr.hb $1
109; MIPS32R6-NEXT:    nop
110; MIPS32R6-NEXT:  $BB0_2: # %sw.bb
111; MIPS32R6-NEXT:    lui $1, %hi($.str)
112; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str)
113; MIPS32R6-NEXT:    j $BB0_10
114; MIPS32R6-NEXT:    sw $1, 8($sp)
115; MIPS32R6-NEXT:  $BB0_3: # %sw.epilog
116; MIPS32R6-NEXT:    lui $1, %hi($.str.7)
117; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.7)
118; MIPS32R6-NEXT:    j $BB0_10
119; MIPS32R6-NEXT:    sw $1, 8($sp)
120; MIPS32R6-NEXT:  $BB0_4: # %sw.bb1
121; MIPS32R6-NEXT:    lui $1, %hi($.str.1)
122; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.1)
123; MIPS32R6-NEXT:    j $BB0_10
124; MIPS32R6-NEXT:    sw $1, 8($sp)
125; MIPS32R6-NEXT:  $BB0_5: # %sw.bb2
126; MIPS32R6-NEXT:    lui $1, %hi($.str.2)
127; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.2)
128; MIPS32R6-NEXT:    j $BB0_10
129; MIPS32R6-NEXT:    sw $1, 8($sp)
130; MIPS32R6-NEXT:  $BB0_6: # %sw.bb3
131; MIPS32R6-NEXT:    lui $1, %hi($.str.3)
132; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.3)
133; MIPS32R6-NEXT:    j $BB0_10
134; MIPS32R6-NEXT:    sw $1, 8($sp)
135; MIPS32R6-NEXT:  $BB0_7: # %sw.bb4
136; MIPS32R6-NEXT:    lui $1, %hi($.str.4)
137; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.4)
138; MIPS32R6-NEXT:    j $BB0_10
139; MIPS32R6-NEXT:    sw $1, 8($sp)
140; MIPS32R6-NEXT:  $BB0_8: # %sw.bb5
141; MIPS32R6-NEXT:    lui $1, %hi($.str.5)
142; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.5)
143; MIPS32R6-NEXT:    j $BB0_10
144; MIPS32R6-NEXT:    sw $1, 8($sp)
145; MIPS32R6-NEXT:  $BB0_9: # %sw.bb6
146; MIPS32R6-NEXT:    lui $1, %hi($.str.6)
147; MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.6)
148; MIPS32R6-NEXT:    sw $1, 8($sp)
149; MIPS32R6-NEXT:  $BB0_10: # %return
150; MIPS32R6-NEXT:    lw $2, 8($sp)
151; MIPS32R6-NEXT:    jr $ra
152; MIPS32R6-NEXT:    addiu $sp, $sp, 16
153;
154; MIPS64R2-LABEL: _Z3fooi:
155; MIPS64R2:       # %bb.0: # %entry
156; MIPS64R2-NEXT:    daddiu $sp, $sp, -16
157; MIPS64R2-NEXT:    .cfi_def_cfa_offset 16
158; MIPS64R2-NEXT:    dext $2, $4, 0, 32
159; MIPS64R2-NEXT:    sltiu $1, $2, 7
160; MIPS64R2-NEXT:    beqz $1, .LBB0_3
161; MIPS64R2-NEXT:    sw $4, 4($sp)
162; MIPS64R2-NEXT:  .LBB0_1: # %entry
163; MIPS64R2-NEXT:    dsll $1, $2, 3
164; MIPS64R2-NEXT:    lui $2, %highest(.LJTI0_0)
165; MIPS64R2-NEXT:    daddiu $2, $2, %higher(.LJTI0_0)
166; MIPS64R2-NEXT:    dsll $2, $2, 16
167; MIPS64R2-NEXT:    daddiu $2, $2, %hi(.LJTI0_0)
168; MIPS64R2-NEXT:    dsll $2, $2, 16
169; MIPS64R2-NEXT:    daddu $1, $1, $2
170; MIPS64R2-NEXT:    ld $1, %lo(.LJTI0_0)($1)
171; MIPS64R2-NEXT:    jr.hb $1
172; MIPS64R2-NEXT:    nop
173; MIPS64R2-NEXT:  .LBB0_2: # %sw.bb
174; MIPS64R2-NEXT:    lui $1, %highest(.L.str)
175; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str)
176; MIPS64R2-NEXT:    dsll $1, $1, 16
177; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str)
178; MIPS64R2-NEXT:    dsll $1, $1, 16
179; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str)
180; MIPS64R2-NEXT:    j .LBB0_10
181; MIPS64R2-NEXT:    sd $1, 8($sp)
182; MIPS64R2-NEXT:  .LBB0_3: # %sw.epilog
183; MIPS64R2-NEXT:    lui $1, %highest(.L.str.7)
184; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str.7)
185; MIPS64R2-NEXT:    dsll $1, $1, 16
186; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str.7)
187; MIPS64R2-NEXT:    dsll $1, $1, 16
188; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str.7)
189; MIPS64R2-NEXT:    j .LBB0_10
190; MIPS64R2-NEXT:    sd $1, 8($sp)
191; MIPS64R2-NEXT:  .LBB0_4: # %sw.bb1
192; MIPS64R2-NEXT:    lui $1, %highest(.L.str.1)
193; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str.1)
194; MIPS64R2-NEXT:    dsll $1, $1, 16
195; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str.1)
196; MIPS64R2-NEXT:    dsll $1, $1, 16
197; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str.1)
198; MIPS64R2-NEXT:    j .LBB0_10
199; MIPS64R2-NEXT:    sd $1, 8($sp)
200; MIPS64R2-NEXT:  .LBB0_5: # %sw.bb2
201; MIPS64R2-NEXT:    lui $1, %highest(.L.str.2)
202; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str.2)
203; MIPS64R2-NEXT:    dsll $1, $1, 16
204; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str.2)
205; MIPS64R2-NEXT:    dsll $1, $1, 16
206; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str.2)
207; MIPS64R2-NEXT:    j .LBB0_10
208; MIPS64R2-NEXT:    sd $1, 8($sp)
209; MIPS64R2-NEXT:  .LBB0_6: # %sw.bb3
210; MIPS64R2-NEXT:    lui $1, %highest(.L.str.3)
211; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str.3)
212; MIPS64R2-NEXT:    dsll $1, $1, 16
213; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str.3)
214; MIPS64R2-NEXT:    dsll $1, $1, 16
215; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str.3)
216; MIPS64R2-NEXT:    j .LBB0_10
217; MIPS64R2-NEXT:    sd $1, 8($sp)
218; MIPS64R2-NEXT:  .LBB0_7: # %sw.bb4
219; MIPS64R2-NEXT:    lui $1, %highest(.L.str.4)
220; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str.4)
221; MIPS64R2-NEXT:    dsll $1, $1, 16
222; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str.4)
223; MIPS64R2-NEXT:    dsll $1, $1, 16
224; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str.4)
225; MIPS64R2-NEXT:    j .LBB0_10
226; MIPS64R2-NEXT:    sd $1, 8($sp)
227; MIPS64R2-NEXT:  .LBB0_8: # %sw.bb5
228; MIPS64R2-NEXT:    lui $1, %highest(.L.str.5)
229; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str.5)
230; MIPS64R2-NEXT:    dsll $1, $1, 16
231; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str.5)
232; MIPS64R2-NEXT:    dsll $1, $1, 16
233; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str.5)
234; MIPS64R2-NEXT:    j .LBB0_10
235; MIPS64R2-NEXT:    sd $1, 8($sp)
236; MIPS64R2-NEXT:  .LBB0_9: # %sw.bb6
237; MIPS64R2-NEXT:    lui $1, %highest(.L.str.6)
238; MIPS64R2-NEXT:    daddiu $1, $1, %higher(.L.str.6)
239; MIPS64R2-NEXT:    dsll $1, $1, 16
240; MIPS64R2-NEXT:    daddiu $1, $1, %hi(.L.str.6)
241; MIPS64R2-NEXT:    dsll $1, $1, 16
242; MIPS64R2-NEXT:    daddiu $1, $1, %lo(.L.str.6)
243; MIPS64R2-NEXT:    sd $1, 8($sp)
244; MIPS64R2-NEXT:  .LBB0_10: # %return
245; MIPS64R2-NEXT:    ld $2, 8($sp)
246; MIPS64R2-NEXT:    jr $ra
247; MIPS64R2-NEXT:    daddiu $sp, $sp, 16
248;
249; MIPS64R6-LABEL: _Z3fooi:
250; MIPS64R6:       # %bb.0: # %entry
251; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
252; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
253; MIPS64R6-NEXT:    dext $2, $4, 0, 32
254; MIPS64R6-NEXT:    sltiu $1, $2, 7
255; MIPS64R6-NEXT:    beqz $1, .LBB0_3
256; MIPS64R6-NEXT:    sw $4, 4($sp)
257; MIPS64R6-NEXT:  .LBB0_1: # %entry
258; MIPS64R6-NEXT:    dsll $1, $2, 3
259; MIPS64R6-NEXT:    lui $2, %highest(.LJTI0_0)
260; MIPS64R6-NEXT:    daddiu $2, $2, %higher(.LJTI0_0)
261; MIPS64R6-NEXT:    dsll $2, $2, 16
262; MIPS64R6-NEXT:    daddiu $2, $2, %hi(.LJTI0_0)
263; MIPS64R6-NEXT:    dsll $2, $2, 16
264; MIPS64R6-NEXT:    daddu $1, $1, $2
265; MIPS64R6-NEXT:    ld $1, %lo(.LJTI0_0)($1)
266; MIPS64R6-NEXT:    jr.hb $1
267; MIPS64R6-NEXT:    nop
268; MIPS64R6-NEXT:  .LBB0_2: # %sw.bb
269; MIPS64R6-NEXT:    lui $1, %highest(.L.str)
270; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str)
271; MIPS64R6-NEXT:    dsll $1, $1, 16
272; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str)
273; MIPS64R6-NEXT:    dsll $1, $1, 16
274; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str)
275; MIPS64R6-NEXT:    j .LBB0_10
276; MIPS64R6-NEXT:    sd $1, 8($sp)
277; MIPS64R6-NEXT:  .LBB0_3: # %sw.epilog
278; MIPS64R6-NEXT:    lui $1, %highest(.L.str.7)
279; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str.7)
280; MIPS64R6-NEXT:    dsll $1, $1, 16
281; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str.7)
282; MIPS64R6-NEXT:    dsll $1, $1, 16
283; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str.7)
284; MIPS64R6-NEXT:    j .LBB0_10
285; MIPS64R6-NEXT:    sd $1, 8($sp)
286; MIPS64R6-NEXT:  .LBB0_4: # %sw.bb1
287; MIPS64R6-NEXT:    lui $1, %highest(.L.str.1)
288; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str.1)
289; MIPS64R6-NEXT:    dsll $1, $1, 16
290; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str.1)
291; MIPS64R6-NEXT:    dsll $1, $1, 16
292; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str.1)
293; MIPS64R6-NEXT:    j .LBB0_10
294; MIPS64R6-NEXT:    sd $1, 8($sp)
295; MIPS64R6-NEXT:  .LBB0_5: # %sw.bb2
296; MIPS64R6-NEXT:    lui $1, %highest(.L.str.2)
297; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str.2)
298; MIPS64R6-NEXT:    dsll $1, $1, 16
299; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str.2)
300; MIPS64R6-NEXT:    dsll $1, $1, 16
301; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str.2)
302; MIPS64R6-NEXT:    j .LBB0_10
303; MIPS64R6-NEXT:    sd $1, 8($sp)
304; MIPS64R6-NEXT:  .LBB0_6: # %sw.bb3
305; MIPS64R6-NEXT:    lui $1, %highest(.L.str.3)
306; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str.3)
307; MIPS64R6-NEXT:    dsll $1, $1, 16
308; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str.3)
309; MIPS64R6-NEXT:    dsll $1, $1, 16
310; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str.3)
311; MIPS64R6-NEXT:    j .LBB0_10
312; MIPS64R6-NEXT:    sd $1, 8($sp)
313; MIPS64R6-NEXT:  .LBB0_7: # %sw.bb4
314; MIPS64R6-NEXT:    lui $1, %highest(.L.str.4)
315; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str.4)
316; MIPS64R6-NEXT:    dsll $1, $1, 16
317; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str.4)
318; MIPS64R6-NEXT:    dsll $1, $1, 16
319; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str.4)
320; MIPS64R6-NEXT:    j .LBB0_10
321; MIPS64R6-NEXT:    sd $1, 8($sp)
322; MIPS64R6-NEXT:  .LBB0_8: # %sw.bb5
323; MIPS64R6-NEXT:    lui $1, %highest(.L.str.5)
324; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str.5)
325; MIPS64R6-NEXT:    dsll $1, $1, 16
326; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str.5)
327; MIPS64R6-NEXT:    dsll $1, $1, 16
328; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str.5)
329; MIPS64R6-NEXT:    j .LBB0_10
330; MIPS64R6-NEXT:    sd $1, 8($sp)
331; MIPS64R6-NEXT:  .LBB0_9: # %sw.bb6
332; MIPS64R6-NEXT:    lui $1, %highest(.L.str.6)
333; MIPS64R6-NEXT:    daddiu $1, $1, %higher(.L.str.6)
334; MIPS64R6-NEXT:    dsll $1, $1, 16
335; MIPS64R6-NEXT:    daddiu $1, $1, %hi(.L.str.6)
336; MIPS64R6-NEXT:    dsll $1, $1, 16
337; MIPS64R6-NEXT:    daddiu $1, $1, %lo(.L.str.6)
338; MIPS64R6-NEXT:    sd $1, 8($sp)
339; MIPS64R6-NEXT:  .LBB0_10: # %return
340; MIPS64R6-NEXT:    ld $2, 8($sp)
341; MIPS64R6-NEXT:    jr $ra
342; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
343;
344; PIC-MIPS32R2-LABEL: _Z3fooi:
345; PIC-MIPS32R2:       # %bb.0: # %entry
346; PIC-MIPS32R2-NEXT:    lui $2, %hi(_gp_disp)
347; PIC-MIPS32R2-NEXT:    addiu $2, $2, %lo(_gp_disp)
348; PIC-MIPS32R2-NEXT:    addiu $sp, $sp, -16
349; PIC-MIPS32R2-NEXT:    .cfi_def_cfa_offset 16
350; PIC-MIPS32R2-NEXT:    addu $2, $2, $25
351; PIC-MIPS32R2-NEXT:    sltiu $1, $4, 7
352; PIC-MIPS32R2-NEXT:    beqz $1, $BB0_3
353; PIC-MIPS32R2-NEXT:    sw $4, 4($sp)
354; PIC-MIPS32R2-NEXT:  $BB0_1: # %entry
355; PIC-MIPS32R2-NEXT:    sll $1, $4, 2
356; PIC-MIPS32R2-NEXT:    lw $3, %got($JTI0_0)($2)
357; PIC-MIPS32R2-NEXT:    addu $1, $1, $3
358; PIC-MIPS32R2-NEXT:    lw $1, %lo($JTI0_0)($1)
359; PIC-MIPS32R2-NEXT:    addu $1, $1, $2
360; PIC-MIPS32R2-NEXT:    jr.hb $1
361; PIC-MIPS32R2-NEXT:    nop
362; PIC-MIPS32R2-NEXT:  $BB0_2: # %sw.bb
363; PIC-MIPS32R2-NEXT:    lw $1, %got($.str)($2)
364; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str)
365; PIC-MIPS32R2-NEXT:    b $BB0_10
366; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
367; PIC-MIPS32R2-NEXT:  $BB0_3: # %sw.epilog
368; PIC-MIPS32R2-NEXT:    lw $1, %got($.str.7)($2)
369; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.7)
370; PIC-MIPS32R2-NEXT:    b $BB0_10
371; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
372; PIC-MIPS32R2-NEXT:  $BB0_4: # %sw.bb1
373; PIC-MIPS32R2-NEXT:    lw $1, %got($.str.1)($2)
374; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.1)
375; PIC-MIPS32R2-NEXT:    b $BB0_10
376; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
377; PIC-MIPS32R2-NEXT:  $BB0_5: # %sw.bb2
378; PIC-MIPS32R2-NEXT:    lw $1, %got($.str.2)($2)
379; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.2)
380; PIC-MIPS32R2-NEXT:    b $BB0_10
381; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
382; PIC-MIPS32R2-NEXT:  $BB0_6: # %sw.bb3
383; PIC-MIPS32R2-NEXT:    lw $1, %got($.str.3)($2)
384; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.3)
385; PIC-MIPS32R2-NEXT:    b $BB0_10
386; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
387; PIC-MIPS32R2-NEXT:  $BB0_7: # %sw.bb4
388; PIC-MIPS32R2-NEXT:    lw $1, %got($.str.4)($2)
389; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.4)
390; PIC-MIPS32R2-NEXT:    b $BB0_10
391; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
392; PIC-MIPS32R2-NEXT:  $BB0_8: # %sw.bb5
393; PIC-MIPS32R2-NEXT:    lw $1, %got($.str.5)($2)
394; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.5)
395; PIC-MIPS32R2-NEXT:    b $BB0_10
396; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
397; PIC-MIPS32R2-NEXT:  $BB0_9: # %sw.bb6
398; PIC-MIPS32R2-NEXT:    lw $1, %got($.str.6)($2)
399; PIC-MIPS32R2-NEXT:    addiu $1, $1, %lo($.str.6)
400; PIC-MIPS32R2-NEXT:    sw $1, 8($sp)
401; PIC-MIPS32R2-NEXT:  $BB0_10: # %return
402; PIC-MIPS32R2-NEXT:    lw $2, 8($sp)
403; PIC-MIPS32R2-NEXT:    jr $ra
404; PIC-MIPS32R2-NEXT:    addiu $sp, $sp, 16
405;
406; PIC-MIPS32R6-LABEL: _Z3fooi:
407; PIC-MIPS32R6:       # %bb.0: # %entry
408; PIC-MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
409; PIC-MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
410; PIC-MIPS32R6-NEXT:    addiu $sp, $sp, -16
411; PIC-MIPS32R6-NEXT:    .cfi_def_cfa_offset 16
412; PIC-MIPS32R6-NEXT:    addu $2, $2, $25
413; PIC-MIPS32R6-NEXT:    sltiu $1, $4, 7
414; PIC-MIPS32R6-NEXT:    beqz $1, $BB0_3
415; PIC-MIPS32R6-NEXT:    sw $4, 4($sp)
416; PIC-MIPS32R6-NEXT:  $BB0_1: # %entry
417; PIC-MIPS32R6-NEXT:    sll $1, $4, 2
418; PIC-MIPS32R6-NEXT:    lw $3, %got($JTI0_0)($2)
419; PIC-MIPS32R6-NEXT:    addu $1, $1, $3
420; PIC-MIPS32R6-NEXT:    lw $1, %lo($JTI0_0)($1)
421; PIC-MIPS32R6-NEXT:    addu $1, $1, $2
422; PIC-MIPS32R6-NEXT:    jr.hb $1
423; PIC-MIPS32R6-NEXT:    nop
424; PIC-MIPS32R6-NEXT:  $BB0_2: # %sw.bb
425; PIC-MIPS32R6-NEXT:    lw $1, %got($.str)($2)
426; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str)
427; PIC-MIPS32R6-NEXT:    b $BB0_10
428; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
429; PIC-MIPS32R6-NEXT:  $BB0_3: # %sw.epilog
430; PIC-MIPS32R6-NEXT:    lw $1, %got($.str.7)($2)
431; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.7)
432; PIC-MIPS32R6-NEXT:    b $BB0_10
433; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
434; PIC-MIPS32R6-NEXT:  $BB0_4: # %sw.bb1
435; PIC-MIPS32R6-NEXT:    lw $1, %got($.str.1)($2)
436; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.1)
437; PIC-MIPS32R6-NEXT:    b $BB0_10
438; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
439; PIC-MIPS32R6-NEXT:  $BB0_5: # %sw.bb2
440; PIC-MIPS32R6-NEXT:    lw $1, %got($.str.2)($2)
441; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.2)
442; PIC-MIPS32R6-NEXT:    b $BB0_10
443; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
444; PIC-MIPS32R6-NEXT:  $BB0_6: # %sw.bb3
445; PIC-MIPS32R6-NEXT:    lw $1, %got($.str.3)($2)
446; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.3)
447; PIC-MIPS32R6-NEXT:    b $BB0_10
448; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
449; PIC-MIPS32R6-NEXT:  $BB0_7: # %sw.bb4
450; PIC-MIPS32R6-NEXT:    lw $1, %got($.str.4)($2)
451; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.4)
452; PIC-MIPS32R6-NEXT:    b $BB0_10
453; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
454; PIC-MIPS32R6-NEXT:  $BB0_8: # %sw.bb5
455; PIC-MIPS32R6-NEXT:    lw $1, %got($.str.5)($2)
456; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.5)
457; PIC-MIPS32R6-NEXT:    b $BB0_10
458; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
459; PIC-MIPS32R6-NEXT:  $BB0_9: # %sw.bb6
460; PIC-MIPS32R6-NEXT:    lw $1, %got($.str.6)($2)
461; PIC-MIPS32R6-NEXT:    addiu $1, $1, %lo($.str.6)
462; PIC-MIPS32R6-NEXT:    sw $1, 8($sp)
463; PIC-MIPS32R6-NEXT:  $BB0_10: # %return
464; PIC-MIPS32R6-NEXT:    lw $2, 8($sp)
465; PIC-MIPS32R6-NEXT:    jr $ra
466; PIC-MIPS32R6-NEXT:    addiu $sp, $sp, 16
467;
468; PIC-MIPS64R2-LABEL: _Z3fooi:
469; PIC-MIPS64R2:       # %bb.0: # %entry
470; PIC-MIPS64R2-NEXT:    daddiu $sp, $sp, -16
471; PIC-MIPS64R2-NEXT:    .cfi_def_cfa_offset 16
472; PIC-MIPS64R2-NEXT:    lui $1, %hi(%neg(%gp_rel(_Z3fooi)))
473; PIC-MIPS64R2-NEXT:    daddu $1, $1, $25
474; PIC-MIPS64R2-NEXT:    daddiu $2, $1, %lo(%neg(%gp_rel(_Z3fooi)))
475; PIC-MIPS64R2-NEXT:    dext $3, $4, 0, 32
476; PIC-MIPS64R2-NEXT:    sltiu $1, $3, 7
477; PIC-MIPS64R2-NEXT:    beqz $1, .LBB0_3
478; PIC-MIPS64R2-NEXT:    sw $4, 4($sp)
479; PIC-MIPS64R2-NEXT:  .LBB0_1: # %entry
480; PIC-MIPS64R2-NEXT:    dsll $1, $3, 3
481; PIC-MIPS64R2-NEXT:    ld $3, %got_page(.LJTI0_0)($2)
482; PIC-MIPS64R2-NEXT:    daddu $1, $1, $3
483; PIC-MIPS64R2-NEXT:    ld $1, %got_ofst(.LJTI0_0)($1)
484; PIC-MIPS64R2-NEXT:    daddu $1, $1, $2
485; PIC-MIPS64R2-NEXT:    jr.hb $1
486; PIC-MIPS64R2-NEXT:    nop
487; PIC-MIPS64R2-NEXT:  .LBB0_2: # %sw.bb
488; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str)($2)
489; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str)
490; PIC-MIPS64R2-NEXT:    b .LBB0_10
491; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
492; PIC-MIPS64R2-NEXT:  .LBB0_3: # %sw.epilog
493; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str.7)($2)
494; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str.7)
495; PIC-MIPS64R2-NEXT:    b .LBB0_10
496; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
497; PIC-MIPS64R2-NEXT:  .LBB0_4: # %sw.bb1
498; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str.1)($2)
499; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str.1)
500; PIC-MIPS64R2-NEXT:    b .LBB0_10
501; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
502; PIC-MIPS64R2-NEXT:  .LBB0_5: # %sw.bb2
503; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str.2)($2)
504; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str.2)
505; PIC-MIPS64R2-NEXT:    b .LBB0_10
506; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
507; PIC-MIPS64R2-NEXT:  .LBB0_6: # %sw.bb3
508; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str.3)($2)
509; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str.3)
510; PIC-MIPS64R2-NEXT:    b .LBB0_10
511; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
512; PIC-MIPS64R2-NEXT:  .LBB0_7: # %sw.bb4
513; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str.4)($2)
514; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str.4)
515; PIC-MIPS64R2-NEXT:    b .LBB0_10
516; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
517; PIC-MIPS64R2-NEXT:  .LBB0_8: # %sw.bb5
518; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str.5)($2)
519; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str.5)
520; PIC-MIPS64R2-NEXT:    b .LBB0_10
521; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
522; PIC-MIPS64R2-NEXT:  .LBB0_9: # %sw.bb6
523; PIC-MIPS64R2-NEXT:    ld $1, %got_page(.L.str.6)($2)
524; PIC-MIPS64R2-NEXT:    daddiu $1, $1, %got_ofst(.L.str.6)
525; PIC-MIPS64R2-NEXT:    sd $1, 8($sp)
526; PIC-MIPS64R2-NEXT:  .LBB0_10: # %return
527; PIC-MIPS64R2-NEXT:    ld $2, 8($sp)
528; PIC-MIPS64R2-NEXT:    jr $ra
529; PIC-MIPS64R2-NEXT:    daddiu $sp, $sp, 16
530;
531; PIC-MIPS64R6-LABEL: _Z3fooi:
532; PIC-MIPS64R6:       # %bb.0: # %entry
533; PIC-MIPS64R6-NEXT:    daddiu $sp, $sp, -16
534; PIC-MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
535; PIC-MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(_Z3fooi)))
536; PIC-MIPS64R6-NEXT:    daddu $1, $1, $25
537; PIC-MIPS64R6-NEXT:    daddiu $2, $1, %lo(%neg(%gp_rel(_Z3fooi)))
538; PIC-MIPS64R6-NEXT:    dext $3, $4, 0, 32
539; PIC-MIPS64R6-NEXT:    sltiu $1, $3, 7
540; PIC-MIPS64R6-NEXT:    beqz $1, .LBB0_3
541; PIC-MIPS64R6-NEXT:    sw $4, 4($sp)
542; PIC-MIPS64R6-NEXT:  .LBB0_1: # %entry
543; PIC-MIPS64R6-NEXT:    dsll $1, $3, 3
544; PIC-MIPS64R6-NEXT:    ld $3, %got_page(.LJTI0_0)($2)
545; PIC-MIPS64R6-NEXT:    daddu $1, $1, $3
546; PIC-MIPS64R6-NEXT:    ld $1, %got_ofst(.LJTI0_0)($1)
547; PIC-MIPS64R6-NEXT:    daddu $1, $1, $2
548; PIC-MIPS64R6-NEXT:    jr.hb $1
549; PIC-MIPS64R6-NEXT:    nop
550; PIC-MIPS64R6-NEXT:  .LBB0_2: # %sw.bb
551; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str)($2)
552; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str)
553; PIC-MIPS64R6-NEXT:    b .LBB0_10
554; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
555; PIC-MIPS64R6-NEXT:  .LBB0_3: # %sw.epilog
556; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str.7)($2)
557; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str.7)
558; PIC-MIPS64R6-NEXT:    b .LBB0_10
559; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
560; PIC-MIPS64R6-NEXT:  .LBB0_4: # %sw.bb1
561; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str.1)($2)
562; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str.1)
563; PIC-MIPS64R6-NEXT:    b .LBB0_10
564; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
565; PIC-MIPS64R6-NEXT:  .LBB0_5: # %sw.bb2
566; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str.2)($2)
567; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str.2)
568; PIC-MIPS64R6-NEXT:    b .LBB0_10
569; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
570; PIC-MIPS64R6-NEXT:  .LBB0_6: # %sw.bb3
571; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str.3)($2)
572; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str.3)
573; PIC-MIPS64R6-NEXT:    b .LBB0_10
574; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
575; PIC-MIPS64R6-NEXT:  .LBB0_7: # %sw.bb4
576; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str.4)($2)
577; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str.4)
578; PIC-MIPS64R6-NEXT:    b .LBB0_10
579; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
580; PIC-MIPS64R6-NEXT:  .LBB0_8: # %sw.bb5
581; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str.5)($2)
582; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str.5)
583; PIC-MIPS64R6-NEXT:    b .LBB0_10
584; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
585; PIC-MIPS64R6-NEXT:  .LBB0_9: # %sw.bb6
586; PIC-MIPS64R6-NEXT:    ld $1, %got_page(.L.str.6)($2)
587; PIC-MIPS64R6-NEXT:    daddiu $1, $1, %got_ofst(.L.str.6)
588; PIC-MIPS64R6-NEXT:    sd $1, 8($sp)
589; PIC-MIPS64R6-NEXT:  .LBB0_10: # %return
590; PIC-MIPS64R6-NEXT:    ld $2, 8($sp)
591; PIC-MIPS64R6-NEXT:    jr $ra
592; PIC-MIPS64R6-NEXT:    daddiu $sp, $sp, 16
593entry:
594  %retval = alloca i8*, align 8
595  %Letter.addr = alloca i32, align 4
596  store i32 %Letter, i32* %Letter.addr, align 4
597  %0 = load i32, i32* %Letter.addr, align 4
598  switch i32 %0, label %sw.epilog [
599    i32 0, label %sw.bb
600    i32 1, label %sw.bb1
601    i32 2, label %sw.bb2
602    i32 3, label %sw.bb3
603    i32 4, label %sw.bb4
604    i32 5, label %sw.bb5
605    i32 6, label %sw.bb6
606  ]
607
608sw.bb:
609  store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8** %retval, align 8
610  br label %return
611
612sw.bb1:
613  store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8** %retval, align 8
614  br label %return
615
616sw.bb2:
617  store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8** %retval, align 8
618  br label %return
619
620sw.bb3:
621  store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8** %retval, align 8
622  br label %return
623
624sw.bb4:
625  store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8** %retval, align 8
626  br label %return
627
628sw.bb5:
629  store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i32 0, i32 0), i8** %retval, align 8
630  br label %return
631
632sw.bb6:
633  store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8** %retval, align 8
634  br label %return
635
636sw.epilog:
637  store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i32 0, i32 0), i8** %retval, align 8
638  br label %return
639
640return:
641  %1 = load i8*, i8** %retval, align 8
642  ret i8* %1
643}
644