From 1e89760ddc7a2d8e4153f654ee4411de78b03fb2 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 28 Jun 2000 20:20:22 +0000 Subject: [PATCH] acker1.c: Report failure. * gcc.misc-tests/acker1.c: Report failure. Use return from main, not exit. Include stdio.h. * gcc.misc-tests/dg-11.c: Remove anchors from regexp. * gcc.misc-tests/dg-12.c: Likewise. * gcc.misc-tests/dg-5.c: Likewise. * gcc.misc-tests/dg-6.c: Likewise. * gcc.misc-tests/dg-7.c: Prototype abort. * gcc.misc-tests/dg-9.c: Adjust error-message regexps. * gcc.misc-tests/dhry.h: Include stdlib.h and string.h. * gcc.misc-tests/matrix1.c: Report failure. Use return from main, not exit. * gcc.misc-tests/sieve.c: Use return from main, not exit. * gcc.misc-tests/sort2.c: Use return from main, not exit. From-SVN: r34763 --- gcc/testsuite/ChangeLog | 16 ++++++++++++++++ gcc/testsuite/gcc.misc-tests/acker1.c | 13 ++++++++----- gcc/testsuite/gcc.misc-tests/dg-11.c | 2 +- gcc/testsuite/gcc.misc-tests/dg-12.c | 2 +- gcc/testsuite/gcc.misc-tests/dg-5.c | 2 +- gcc/testsuite/gcc.misc-tests/dg-6.c | 2 +- gcc/testsuite/gcc.misc-tests/dg-7.c | 1 + gcc/testsuite/gcc.misc-tests/dg-9.c | 6 +++--- gcc/testsuite/gcc.misc-tests/dhry.h | 2 ++ gcc/testsuite/gcc.misc-tests/matrix1.c | 4 ++-- gcc/testsuite/gcc.misc-tests/sieve.c | 2 +- gcc/testsuite/gcc.misc-tests/sort2.c | 2 +- 12 files changed, 38 insertions(+), 16 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d6926ddbb2a..655b6d6e47c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2000-06-28 Zack Weinberg + + * gcc.misc-tests/acker1.c: Report failure. Use return from main, + not exit. Include stdio.h. + * gcc.misc-tests/dg-11.c: Remove anchors from regexp. + * gcc.misc-tests/dg-12.c: Likewise. + * gcc.misc-tests/dg-5.c: Likewise. + * gcc.misc-tests/dg-6.c: Likewise. + * gcc.misc-tests/dg-7.c: Prototype abort. + * gcc.misc-tests/dg-9.c: Adjust error-message regexps. + * gcc.misc-tests/dhry.h: Include stdlib.h and string.h. + * gcc.misc-tests/matrix1.c: Report failure. Use return from main, + not exit. + * gcc.misc-tests/sieve.c: Use return from main, not exit. + * gcc.misc-tests/sort2.c: Use return from main, not exit. + 2000-06-28 Jakub Jelinek * gcc.dg/cpp/20000628-1.c: New test. diff --git a/gcc/testsuite/gcc.misc-tests/acker1.c b/gcc/testsuite/gcc.misc-tests/acker1.c index 9e77e42bedd..aa9d1063cee 100644 --- a/gcc/testsuite/gcc.misc-tests/acker1.c +++ b/gcc/testsuite/gcc.misc-tests/acker1.c @@ -1,11 +1,14 @@ +#include + int acker(int, int); -void main() +int +main(void) { - acker(3,6); - /* */ - exit(0); - /* */ + int n = acker(3,6); + if (n != 509) + printf("acker(3,6) = %d != 509\n", n); + return(0); } int diff --git a/gcc/testsuite/gcc.misc-tests/dg-11.c b/gcc/testsuite/gcc.misc-tests/dg-11.c index e4f86ba2b12..bfbba4d1216 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-11.c +++ b/gcc/testsuite/gcc.misc-tests/dg-11.c @@ -2,7 +2,7 @@ /* { dg-prms-id 42 } */ /* { dg-do run { target sparc-sun-solaris2* } } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ -/* { dg-output {^Hello world[.]$} } */ +/* { dg-output {Hello world[.]} } */ #include diff --git a/gcc/testsuite/gcc.misc-tests/dg-12.c b/gcc/testsuite/gcc.misc-tests/dg-12.c index ad0870d88cc..c6adbf53d95 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-12.c +++ b/gcc/testsuite/gcc.misc-tests/dg-12.c @@ -2,7 +2,7 @@ /* { dg-prms-id 42 } */ /* { dg-do run { target foo-bar-eh } } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ -/* { dg-output {^Hello world[.]$} } */ +/* { dg-output {Hello world[.]} } */ #include diff --git a/gcc/testsuite/gcc.misc-tests/dg-5.c b/gcc/testsuite/gcc.misc-tests/dg-5.c index 33a5b4e893b..178fcb85a4d 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-5.c +++ b/gcc/testsuite/gcc.misc-tests/dg-5.c @@ -2,7 +2,7 @@ /* { dg-prms-id 42 } */ /* { dg-do run } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ -/* { dg-output {^Hello world[.]$} } */ +/* { dg-output {Hello world[.]} } */ #include diff --git a/gcc/testsuite/gcc.misc-tests/dg-6.c b/gcc/testsuite/gcc.misc-tests/dg-6.c index f9273f873ee..8323792c918 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-6.c +++ b/gcc/testsuite/gcc.misc-tests/dg-6.c @@ -2,7 +2,7 @@ /* { dg-prms-id 42 } */ /* { dg-do run { target *-*-* } } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ -/* { dg-output {^Hello world[.]$} { xfail *-*-* } } */ +/* { dg-output {Hello world[.]} { xfail *-*-* } } */ #include diff --git a/gcc/testsuite/gcc.misc-tests/dg-7.c b/gcc/testsuite/gcc.misc-tests/dg-7.c index 068749f71b2..adde4cb60d2 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-7.c +++ b/gcc/testsuite/gcc.misc-tests/dg-7.c @@ -1,5 +1,6 @@ /* Test the tester. */ /* { dg-prms-id 42 } */ /* { dg-do run { xfail *-*-* } } */ +extern void abort (void); main () { abort (); return 0; } diff --git a/gcc/testsuite/gcc.misc-tests/dg-9.c b/gcc/testsuite/gcc.misc-tests/dg-9.c index 43b7ab34b0d..c4926efe176 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-9.c +++ b/gcc/testsuite/gcc.misc-tests/dg-9.c @@ -3,12 +3,12 @@ /* { dg-options "-Wall" } */ f () -{ /* { dg-warning "return-type" "warning test" } */ +{ /* { dg-warning "return type" "warning test" } */ } /* { dg-warning "control reaches end" "warning test" } */ main (int argc, char *argv[]) -{ /* { dg-warning "return-type" "warning test" } */ - foo a; /* { dg-error "syntax" "error test" } */ +{ /* { dg-warning "return type" "warning test" } */ + +; /* { dg-error "parse" "error test 2" { target *-*-* } 11 } */ /* { dg-bogus "foobar" "bogus fail test" } */ return a; /* { dg-bogus "undeclared|identifier|appears" "bogus pass test" { xfail *-*-* } } */ diff --git a/gcc/testsuite/gcc.misc-tests/dhry.h b/gcc/testsuite/gcc.misc-tests/dhry.h index 8d42da0094d..3e04260dd5c 100644 --- a/gcc/testsuite/gcc.misc-tests/dhry.h +++ b/gcc/testsuite/gcc.misc-tests/dhry.h @@ -392,6 +392,8 @@ /* General definitions: */ #include +#include +#include /* for strcpy, strcmp */ #define Null 0 diff --git a/gcc/testsuite/gcc.misc-tests/matrix1.c b/gcc/testsuite/gcc.misc-tests/matrix1.c index 62c71150791..f25a367fb94 100644 --- a/gcc/testsuite/gcc.misc-tests/matrix1.c +++ b/gcc/testsuite/gcc.misc-tests/matrix1.c @@ -35,12 +35,12 @@ int i,j,k; { if (c[i][j] != BOUND) { - /*printf("ERROR\n");*/ + puts("ERROR"); return 0; } } } i=5; - exit (0); + return 0; } diff --git a/gcc/testsuite/gcc.misc-tests/sieve.c b/gcc/testsuite/gcc.misc-tests/sieve.c index 41897f178c4..de250e8e5a0 100644 --- a/gcc/testsuite/gcc.misc-tests/sieve.c +++ b/gcc/testsuite/gcc.misc-tests/sieve.c @@ -21,6 +21,6 @@ main() } } } -/* */ exit(0); /* */ + return 0; } diff --git a/gcc/testsuite/gcc.misc-tests/sort2.c b/gcc/testsuite/gcc.misc-tests/sort2.c index 3d86e1ecc24..06b150b93d6 100644 --- a/gcc/testsuite/gcc.misc-tests/sort2.c +++ b/gcc/testsuite/gcc.misc-tests/sort2.c @@ -23,7 +23,7 @@ for (L = 0; L < 1000; L++) { Sort_array(Tab,99); /* Sort it. */ /* Print_array(); */ } -/* */ exit(0); /* */ + return 0; } void Sort_array(Tab,Last) int Tab[]; int Last; {