summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/nios2/gprel-offset.c
blob: 05186c66adbb6965207b449a94f09af64eaaea1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O2" } */

static struct s {
  int x;
  char y;
} s;

void set (char c)
{
  s.y = c;
}


char get (void)
{
  return s.y;
}

/* { dg-final { scan-assembler-times "%gprel\\(s\\+4\\)\\(gp\\)" 2 } } */