summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/mips-sdata-1.c
blob: 8ffd4d84857d39ae903f08f1e03cf830112ecbbb (plain)
1
2
3
4
5
6
7
8
9
10
/* Check that sdata-accesses are applied regardless of size or ABI.  */
/* { dg-options -mexplicit-relocs } */
/* { dg-do compile { target mips*-*-elf* } } */

struct s { int x[4]; };
struct s my_struct __attribute__((__section__(".sdata")));

int f() { return my_struct.x[0]; }

/* { dg-final { scan-assembler {gp_?rel\(my_struct} } } */