Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr34263.c
blobbe1b3ba31ae41987740d8f4f3e56a0668306a271
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3 /* Same test as 990128-1.c. */
5 extern int printf (const char *,...);
6 extern void abort (void);
8 struct s { struct s *n; } *p;
9 struct s ss;
10 #define MAX 10
11 struct s sss[MAX];
12 int count = 0;
14 void sub( struct s *p, struct s **pp );
15 int look( struct s *p, struct s **pp );
17 int
18 main()
20 struct s *pp;
21 struct s *next;
22 int i;
24 p = &ss;
25 next = p;
26 for ( i = 0; i < MAX; i++ ) {
27 next->n = &sss[i];
28 next = next->n;
30 next->n = 0;
32 sub( p, &pp );
33 if (count != MAX+2)
34 abort ();
36 return( 0 );
39 void sub( struct s *p, struct s **pp )
41 for ( ; look( p, pp ); ) {
42 if ( p )
43 p = p->n;
44 else
45 break;
49 int look( struct s *p, struct s **pp )
51 for ( ; p; p = p->n )
53 *pp = p;
54 count++;
55 return( 1 );
58 /* { dg-final { scan-tree-dump "Cleaned-up latch block of loop with single BB" "optimized" { xfail { *-*-* } } } } */