summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/20021018-1.c
blob: f11de4859ef8d7cf3f0777a19c929312eeda1483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do run } */
/* { dg-options "-O2 -fpic" } */

extern void abort (void);
extern void exit (int);

static const long foo [10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

long __attribute__((noinline))
bar (int x)
{
  return foo [x - 0x6ffffffa];
}

int
main (void)
{
  if (bar (0x6ffffffc) != 2)
    abort ();
  exit (0);
}
OpenPOWER on IntegriCloud