Add new test to verify that the array index, limit, and stride are
[official-gcc.git] / gcc / testsuite / gcc.dg / pr30137-2.c
blob53be1633b7be228810b1fde87d5a07925865c54d
1 /* { dg-do compile } */
2 /* { dg-options "-w -fdump-tree-gimple" } */
4 /* Things that should be folded. */
6 struct { long base; int tail; void * volatile ptr; } *s;
7 int foo1a (void) { return (s == &s->base); }
8 int foo1b (void) { return (&s->base == s); }
9 int foo2 (void) { return ((void *)s == (void *) &s->base); }
10 int foo4 (void) { return s->base == s->base; }
11 int foo5 (void) { return &s->ptr == &s->ptr; }
12 int foo6 (void) { return &s->ptr != &s->ptr; }
13 int foo7 (void) { return &s->base != &s->ptr; }
15 struct { union { int i; short s } u; } x;
16 int foo8 (void) { return &x.u.i == &x.u.s; }
18 /* { dg-final { scan-tree-dump-times "= 0" 1 "gimple" } } */
19 /* { dg-final { scan-tree-dump-times "= 1" 7 "gimple" } } */
20 /* { dg-final { cleanup-tree-dump "gimple" } } */