Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / testsuite / gcc.target / mips / code-readable-1.c
blob71e7114ffccd2528fdc55fa822a3b6a422f54aa3
1 /* { dg-options "(-mips16) -mcode-readable=yes -mgp32 addressing=absolute" } */
2 /* { dg-skip-if ".half requires -O" { *-*-* } { "-O0" } { "" } } */
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 volatile int x8;
12 volatile int x9;
13 volatile int x10;
14 volatile int x11;
16 MIPS16 int
17 foo (int i, volatile int *x)
19 switch (i)
21 case 1: return x1 + x[0];
22 case 2: return x2 + x[1];
23 case 3: return x3 + x[2];
24 case 4: return x4 + x[3];
25 case 5: return x5 + x[4];
26 case 6: return x6 + x[5];
27 case 7: return x7 + x[6];
28 case 8: return x8 + x[7];
29 case 9: return x9 + x[8];
30 case 10: return x10 + x[9];
31 case 11: return x11 + x[10];
32 default: return 0;
36 extern int k[];
38 MIPS16 int *
39 bar (void)
41 return k;
44 /* { dg-final { scan-assembler "\tla\t" } } */
45 /* { dg-final { scan-assembler "\t\\.half\t" } } */
46 /* { dg-final { scan-assembler-not "%hi\\(\[^)\]*L" } } */
47 /* { dg-final { scan-assembler-not "%lo\\(\[^)\]*L" } } */
49 /* { dg-final { scan-assembler "\t\\.word\tk\n" } } */
50 /* { dg-final { scan-assembler-not "%hi\\(k\\)" } } */
51 /* { dg-final { scan-assembler-not "%lo\\(k\\)" } } */