OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr41935.c] - Blame information for rev 754

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* PR middle-end/41935 */
2
/* { dg-do run } */
3
/* { dg-options "-O2" } */
4
 
5
extern void abort (void);
6
struct A { int a; int b[10]; };
7
 
8
int
9
foo (struct A *p)
10
{
11
  return __builtin_offsetof (struct A, b[p->a]);
12
}
13
 
14
int
15
main ()
16
{
17
  struct A a;
18
  a.a = 7;
19
  if (foo (&a) != 7 * sizeof (int) + __builtin_offsetof (struct A, b))
20
    abort ();
21
  a.a = 2;
22
  if (foo (&a) != 2 * sizeof (int) + __builtin_offsetof (struct A, b))
23
    abort ();
24
  return 0;
25
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.