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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr41935.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* PR middle-end/41935 */
2
 
3
extern void abort (void);
4
 
5
long int
6
foo (int n, int i, int j)
7
{
8
  typedef int T[n];
9
  struct S { int a; T b[n]; };
10
  return __builtin_offsetof (struct S, b[i][j]);
11
}
12
 
13
int
14
main (void)
15
{
16
  typedef int T[5];
17
  struct S { int a; T b[5]; };
18
  if (foo (5, 2, 3)
19
      != __builtin_offsetof (struct S, b) + (5 * 2 + 3) * sizeof (int))
20
    abort ();
21
  if (foo (5, 5, 5)
22
      != __builtin_offsetof (struct S, b) + (5 * 5 + 5) * sizeof (int))
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.