OSDN Git Service

For Greta Yorsh.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / forwprop-11.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target int32plus } */
3 /* { dg-options "-O -fdump-tree-forwprop1" } */
4
5 int f(int *p, int n)
6 {
7   int (*a)[n] = (int (*)[n])p;
8   int *q = &(*a)[0];
9   return q[1];
10 }
11
12 int g(int *p, int n)
13 {
14   int (*a)[n] = (int (*)[n])p;
15   int *q = &(*a)[2];
16   return q[-1];
17 }
18
19 /* { dg-final { scan-tree-dump-times "= MEM\\\[\\\(int \\\*\\\)a_.. \\\+ 4B\\\];" 2 "forwprop1" } } */
20 /* { dg-final { cleanup-tree-dump "forwprop1" } } */