Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / mips / sdata-3.c
blob6705ee35a8e26949f5fb013520efcecf82fd1052
1 /* { dg-options "-G4 -mexplicit-relocs -mno-extern-sdata" } */
3 /* { dg-final { scan-assembler "%gp_?rel\\(l4a\\)" } } */
4 /* { dg-final { scan-assembler "%gp_?rel\\(l4b\\)" } } */
5 /* { dg-final { scan-assembler "%gp_?rel\\(l4c\\)" } } */
6 /* { dg-final { scan-assembler-not "%gp_?rel\\(e4a\\)" } } */
7 /* { dg-final { scan-assembler "%gp_?rel\\(e4b\\)" } } */
8 /* { dg-final { scan-assembler-not "%gp_?rel\\(c4\\)" } } */
9 /* { dg-final { scan-assembler "%gp_?rel\\(g4a\\)" } } */
10 /* { dg-final { scan-assembler "%gp_?rel\\(g4b\\)" } } */
11 /* { dg-final { scan-assembler "%gp_?rel\\(g4c\\)" } } */
13 /* { dg-final { scan-assembler-not "%gp_?rel\\(l8a\\)" } } */
14 /* { dg-final { scan-assembler-not "%gp_?rel\\(l8b\\)" } } */
15 /* { dg-final { scan-assembler "%gp_?rel\\(l8c\\)" } } */
16 /* { dg-final { scan-assembler-not "%gp_?rel\\(e8a\\)" } } */
17 /* { dg-final { scan-assembler "%gp_?rel\\(e8b\\)" } } */
18 /* { dg-final { scan-assembler-not "%gp_?rel\\(c8\\)" } } */
19 /* { dg-final { scan-assembler-not "%gp_?rel\\(g8a\\)" } } */
20 /* { dg-final { scan-assembler-not "%gp_?rel\\(g8b\\)" } } */
21 /* { dg-final { scan-assembler "%gp_?rel\\(g8c\\)" } } */
23 static volatile int l4a;
24 static volatile int l4b = 1;
25 static volatile int __attribute__((section(".sdata"))) l4c;
26 extern int e4a;
27 extern int __attribute__((section(".sdata"))) e4b;
28 int __attribute__((common)) c4;
29 int __attribute__((nocommon)) g4a;
30 int g4b = 1;
31 int __attribute__((section(".sdata"))) g4c = 2;
33 static volatile int l8a[2];
34 static volatile int l8b[2] = { 1, 2 };
35 static volatile int __attribute__((section(".sdata"))) l8c[2];
36 extern int e8a[2];
37 extern int __attribute__((section(".sdata"))) e8b[2];
38 int __attribute__((common)) c8[2];
39 int __attribute__((nocommon)) g8a[2];
40 int g8b[2] = { 1, 2 };
41 int __attribute__((section(".sdata"))) g8c[2] = { 1, 2 };
43 int f32a (void) { return l4a; }
44 int f32b (void) { return l4b; }
45 int f32c (void) { return l4c; }
46 int f32d (void) { return e4a; }
47 int f32e (void) { return e4b; }
48 int f32f (void) { return c4; }
49 int f32g (void) { return g4a; }
50 int f32h (void) { return g4b; }
51 int f32i (void) { return g4c; }
53 int f64a (void) { return l8a[0]; }
54 int f64b (void) { return l8b[0]; }
55 int f64c (void) { return l8c[0]; }
56 int f64d (void) { return e8a[0]; }
57 int f64e (void) { return e8b[0]; }
58 int f64f (void) { return c8[0]; }
59 int f64g (void) { return g8a[0]; }
60 int f64h (void) { return g8b[0]; }
61 int f64i (void) { return g8c[0]; }