summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-28 16:05:21 +0000
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-28 16:05:21 +0000
commitdc5ca76ac630b6e198e7084e353ca4abcc46b82e (patch)
tree6c382664db1ebfe40169701253c1127d3dd0fbe3
parentd02be3f56a3800fc73d566bbbd71b45c600d38cf (diff)
downloadppe42-gcc-dc5ca76ac630b6e198e7084e353ca4abcc46b82e.tar.gz
ppe42-gcc-dc5ca76ac630b6e198e7084e353ca4abcc46b82e.zip
add new test
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24897 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/gcc.c-torture/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/990128-1.c50
2 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog
index abecc17003f..3f160c5c416 100644
--- a/gcc/testsuite/gcc.c-torture/ChangeLog
+++ b/gcc/testsuite/gcc.c-torture/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.c-torture/execute/990128-1.c b/gcc/testsuite/gcc.c-torture/execute/990128-1.c
new file mode 100644
index 00000000000..cfdab3e87e5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/990128-1.c
@@ -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 );
+}
OpenPOWER on IntegriCloud