1 /* { dg-options "(-mips16) -mcode-readable=yes -mgp32 addressing=absolute" } */
2 /* { dg-skip-if ".half requires -O" { *-*-* } { "-O0" } { "" } } */
3
4 volatile int x1;
5 volatile int x2;
6 volatile int x3;
7 volatile int x4;
8 volatile int x5;
9 volatile int x6;
10 volatile int x7;
11
12 MIPS16 int
foo(int i,volatile * x)13 foo (int i, volatile *x)
14 {
15 switch (i)
16 {
17 case 1: return x1 + x[0];
18 case 2: return x2 + x[1];
19 case 3: return x3 + x[2];
20 case 4: return x4 + x[3];
21 case 5: return x5 + x[4];
22 case 6: return x6 + x[5];
23 case 7: return x7 + x[6];
24 default: return 0;
25 }
26 }
27
28 extern int k[];
29
30 MIPS16 int *
bar(void)31 bar (void)
32 {
33 return k;
34 }
35
36 /* { dg-final { scan-assembler "\tla\t" } } */
37 /* { dg-final { scan-assembler "\t\\.half\t" } } */
38 /* { dg-final { scan-assembler-not "%hi\\(\[^)\]*L" } } */
39 /* { dg-final { scan-assembler-not "%lo\\(\[^)\]*L" } } */
40
41 /* { dg-final { scan-assembler "\t\\.word\tk\n" } } */
42 /* { dg-final { scan-assembler-not "%hi\\(k\\)" } } */
43 /* { dg-final { scan-assembler-not "%lo\\(k\\)" } } */
44