aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/nios2/nios2-cache-2.c
blob: 239c600ac56c2e6e56d1a05ddfe20d2612b05d29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-O2 -mno-cache-volatile" } */
/* { dg-final { scan-assembler "ldwio" } } */
/* { dg-final { scan-assembler "stwio" } } */

/* Make sure -mno-cache-volatile generates I/O variants of the load and
   stores to foo.  */

extern volatile int foo;

int
read_foo (void)
{
  return foo;
}

void
write_foo (int x)
{
  foo = x;
}