/* PR tree-optimization/14841
|
/* PR tree-optimization/14841
|
Make sure that we can fold a possible nested reference into a
|
Make sure that we can fold a possible nested reference into a
|
constant aggregate. */
|
constant aggregate. */
|
|
|
/* { dg-do link } */
|
/* { dg-do link } */
|
/* { dg-options "-O" } */
|
/* { dg-options "-O" } */
|
|
|
struct car {
|
struct car {
|
int speed;
|
int speed;
|
int tire_pressure[4];
|
int tire_pressure[4];
|
};
|
};
|
|
|
static const struct car cars[] = {
|
static const struct car cars[] = {
|
{ 75, { 10, 20, 30, 40 } },
|
{ 75, { 10, 20, 30, 40 } },
|
{ 35, { 12, 34, 56, 78 } },
|
{ 35, { 12, 34, 56, 78 } },
|
{ 40, { 19, 28, 37, 46 } }
|
{ 40, { 19, 28, 37, 46 } }
|
};
|
};
|
|
|
extern void link_error (void);
|
extern void link_error (void);
|
|
|
void
|
void
|
foo (void)
|
foo (void)
|
{
|
{
|
if (cars[1].tire_pressure[2] != 56)
|
if (cars[1].tire_pressure[2] != 56)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
int main () { return 0; }
|
int main () { return 0; }
|
|
|
|
|