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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr14841.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR tree-optimization/14841
2
   Make sure that we can fold a possible nested reference into a
3
   constant aggregate.  */
4
 
5
/* { dg-do compile } */
6
/* { dg-options "-O2 -fdump-tree-store_ccp-details" } */
7
 
8
struct car {
9
  int speed;
10
  int tire_pressure[4];
11
};
12
 
13
static const struct car cars[] = {
14
  { 75, { 10, 20, 30, 40 } },
15
  { 35, { 12, 34, 56, 78 } },
16
  { 40, { 19, 28, 37, 46 } }
17
};
18
 
19
extern void link_error (void);
20
 
21
void
22
foo (void)
23
{
24
  if (cars[1].tire_pressure[2] != 56)
25
    link_error ();
26
}
27
 
28
/* { dg-final { scan-tree-dump-times "Folded statement: if " 1 "store_ccp"} } */
29
/* { dg-final { cleanup-tree-dump "store_ccp" } } */

powered by: WebSVN 2.1.0

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