OSDN Git Service

PR c/20740
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / max-1.c
1 /* PR middle-end/18548 */
2 /* Test case reduced by Andrew Pinski <pinskia@physics.uc.edu> */
3 /* { dg-do run } */
4 /* { dg-options "-O1 -fno-tree-lrs" } */
5
6 extern void abort (void);
7
8 long fff[10];
9
10 void f(long a, long b)
11 {
12   long crcc = b;
13   long d = *((long*)(a+1));
14   int i;
15
16   a = d >= b? d:b;
17
18
19   for(i=0;i<10;i++)
20    fff[i] = a;
21 }
22
23 int main(void)
24 {
25   int i;
26   long a = 10;
27   f((long)(&a)-1,0);
28   for(i = 0;i<10;i++)
29    if (fff[i]!=10)
30     abort ();
31   return 0;
32 }
33