aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ia64-fptr-1.c
blob: 8dc2efa2964ce28b905d5c76c0fcde93c6412e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* { dg-do run { target ia64-*-linux* } } */
/* { dg-options "-O2" } */

/* Test function descriptor access.  */

extern unsigned long *_GLOBAL_OFFSET_TABLE_;
extern void abort(void);

struct ia64_fdesc
{
  unsigned long func;
  unsigned long gp;
};

void
os_boot_rendez (void)
{
}

static int
check (unsigned long gp)
{
  return gp != (unsigned long) &_GLOBAL_OFFSET_TABLE_;
}

int
main (int argc, char **argv)
{
  int i;
  int res = 0;

  for (i = 0; i < 1; i++)
    res += check (((struct ia64_fdesc *) os_boot_rendez)->gp);
  if (res)
    abort ();
  return res;
}