diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nios2/gpopt-gprel-sec.c | 38 |
2 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c035cd7..f8d8249 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-10-26 Sandra Loosemore <sandra@codesourcery.com> + + * gcc.target/nios2/gpopt-gprel-sec.c: New. + 2017-10-26 Olga Makhotina <olga.makhotina@intel.com> * gcc.target/i386/avx512f-vcmpps-1.c (_mm512_cmpeq_ps_mask, diff --git a/gcc/testsuite/gcc.target/nios2/gpopt-gprel-sec.c b/gcc/testsuite/gcc.target/nios2/gpopt-gprel-sec.c new file mode 100644 index 0000000..1083fe6 --- /dev/null +++ b/gcc/testsuite/gcc.target/nios2/gpopt-gprel-sec.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mgpopt=local -mgprel-sec=\\.frog.+" } */ + +extern int a __attribute__ ((section (".frog1"))); +static volatile int b __attribute__ ((section (".frog2"))) = 1; +extern int c __attribute__ ((section (".data"))); +static volatile int d __attribute__ ((section (".data"))) = 2; + +extern int e; +static volatile int f = 3; + +volatile int g __attribute__ ((weak)) = 4; + +extern int h[100]; +static int i[100]; +static int j[100] __attribute__ ((section (".sdata"))); + +typedef int (*ftype) (int); +extern int foo (int); + +extern int bar (int, int*, int*, int*, ftype); + +int baz (void) +{ + return bar (a + b + c + d + e + f + g, h, i, j, foo); +} + +/* { dg-final { scan-assembler "%gprel\\(a\\)" } } */ +/* { dg-final { scan-assembler "%gprel\\(b\\)" } } */ +/* { dg-final { scan-assembler-not "%gprel\\(c\\)" } } */ +/* { dg-final { scan-assembler-not "%gprel\\(d\\)" } } */ +/* { dg-final { scan-assembler-not "%gprel\\(e\\)" } } */ +/* { dg-final { scan-assembler "%gprel\\(f\\)" } } */ +/* { dg-final { scan-assembler-not "%gprel\\(g\\)" } } */ +/* { dg-final { scan-assembler-not "%gprel\\(h\\)" } } */ +/* { dg-final { scan-assembler-not "%gprel\\(i\\)" } } */ +/* { dg-final { scan-assembler "%gprel\\(j\\)" } } */ +/* { dg-final { scan-assembler-not "%gprel\\(foo\\)" } } */ |