add new test
From-SVN: r24897
This commit is contained in:
parent
5e5c976894
commit
07b1b0304a
@ -1,3 +1,7 @@
|
||||
1999-01-28 Michael Meissner <meissner@cygnus.com>
|
||||
|
||||
* execute/990128-1.c: New test.
|
||||
|
||||
1999-01-27 Michael Meissner <meissner@cygnus.com>
|
||||
|
||||
* execute/990127-{1,2}.c: New tests.
|
||||
|
50
gcc/testsuite/gcc.c-torture/execute/990128-1.c
Normal file
50
gcc/testsuite/gcc.c-torture/execute/990128-1.c
Normal file
@ -0,0 +1,50 @@
|
||||
extern int printf (const char *,...);
|
||||
|
||||
struct s { struct s *n; } *p;
|
||||
struct s ss;
|
||||
#define MAX 10
|
||||
struct s sss[MAX];
|
||||
int count = 0;
|
||||
|
||||
void sub( struct s *p, struct s **pp );
|
||||
int look( struct s *p, struct s **pp );
|
||||
|
||||
main()
|
||||
{
|
||||
struct s *pp;
|
||||
struct s *next;
|
||||
int i;
|
||||
|
||||
p = &ss;
|
||||
next = p;
|
||||
for ( i = 0; i < MAX; i++ ) {
|
||||
next->n = &sss[i];
|
||||
next = next->n;
|
||||
}
|
||||
next->n = 0;
|
||||
|
||||
sub( p, &pp );
|
||||
if (count != MAX+2)
|
||||
abort ();
|
||||
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
void sub( struct s *p, struct s **pp )
|
||||
{
|
||||
for ( ; look( p, pp ); ) {
|
||||
if ( p )
|
||||
p = p->n;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int look( struct s *p, struct s **pp )
|
||||
{
|
||||
for ( ; p; p = p->n )
|
||||
;
|
||||
*pp = p;
|
||||
count++;
|
||||
return( 1 );
|
||||
}
|
Loading…
Reference in New Issue
Block a user