]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/max-1.c
3eb7800a7f4c300e9546f69ad5e86dcb5cf19f65
[thirdparty/gcc.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 " } */
5 /* Option -fno-tree-lrs removed By Andrew MacLeod since it is no longer
6 supported in the compiler beginning with GCC 4.3. */
7 /* m32c has varying sized pointers */
8 /* { dg-skip-if "" { "m32c-*-*" } { "*" } { "-mcpu=m32c" "-mcpu=m32cm" } } */
9
10 extern void abort (void);
11
12 long fff[10];
13
14 void f(long a, long b)
15 {
16 long crcc = b;
17 long d = *((long*)(a+1));
18 int i;
19
20 a = d >= b? d:b;
21
22
23 for(i=0;i<10;i++)
24 fff[i] = a;
25 }
26
27 int main(void)
28 {
29 int i;
30 long a = 10;
31 f((long)(&a)-1,0);
32 for(i = 0;i<10;i++)
33 if (fff[i]!=10)
34 abort ();
35 return 0;
36 }
37