URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
/* PR middle-end/41935 */
|
/* PR middle-end/41935 */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
long int
|
long int
|
foo (int n, int i, int j)
|
foo (int n, int i, int j)
|
{
|
{
|
typedef int T[n];
|
typedef int T[n];
|
struct S { int a; T b[n]; };
|
struct S { int a; T b[n]; };
|
return __builtin_offsetof (struct S, b[i][j]);
|
return __builtin_offsetof (struct S, b[i][j]);
|
}
|
}
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
typedef int T[5];
|
typedef int T[5];
|
struct S { int a; T b[5]; };
|
struct S { int a; T b[5]; };
|
if (foo (5, 2, 3)
|
if (foo (5, 2, 3)
|
!= __builtin_offsetof (struct S, b) + (5 * 2 + 3) * sizeof (int))
|
!= __builtin_offsetof (struct S, b) + (5 * 2 + 3) * sizeof (int))
|
abort ();
|
abort ();
|
if (foo (5, 5, 5)
|
if (foo (5, 5, 5)
|
!= __builtin_offsetof (struct S, b) + (5 * 5 + 5) * sizeof (int))
|
!= __builtin_offsetof (struct S, b) + (5 * 5 + 5) * sizeof (int))
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.