aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/nios2/r2-io-range.c
blob: 2064ff6b0d4d69023cb6c2b1fc5b6c3353252bb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-options "-O2 -march=r2 -mbypass-cache" } */

/* Check that the compiler is aware of the reduced offset range for ldio/stio
   instructions in the Nios II R2 encoding.  */

unsigned int too_big (unsigned int *p)
{
  return *(p + 0x400);
}

unsigned int small_enough (unsigned int *p)
{
  return *(p + 0x100);
}

/* { dg-final { scan-assembler-not "\tldwio\t.*, 4096\\(r.*\\)" } }  */
/* { dg-final { scan-assembler "\tldwio\t.*, 1024\\(r.*\\)" } }  */