use dg-message in various testcases (2)

Manuel López-Ibáñez lopezibanez@gmail.com
Tue Jun 5 20:46:00 GMT 2007


:ADDPATCH testsuite:

This patch fixes some testcases to use dg-message for output that is
neither an error, nor a warning.

Tested on i686-pc-linux-gnu.

OK to commit?

2007-06-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

  PR testsuite/25241
  * gcc.dg/invalid-call-1.c: Use dg-warning to match the warning and
dg-message to match de note.
  * gcc.dg/pr26570.c: Use dg-message for a note.
  * gcc.dg/pr29254.c: Use dg-message for generic output and use
dg-error instead of dg-warning because of -Werror.
  * gcc.dg/glibc-uclibc-1.c: Use dg-message for output that is neither
an error, nor a warning.
  * gcc.dg/glibc-uclibc-2.c: Likewise
  * gcc.dg/cpp/19940712-1.c: Likewise.
-------------- next part --------------
Index: gcc/testsuite/gcc.dg/pr26570.c
===================================================================
--- gcc/testsuite/gcc.dg/pr26570.c	(revision 125317)
+++ gcc/testsuite/gcc.dg/pr26570.c	(working copy)
@@ -2,8 +2,8 @@
 /* { dg-options "-O2 -fprofile-generate -fprofile-use" } */
 
 unsigned test (unsigned a, unsigned b)
 {
   return a / b;
-} /* { dg-warning "execution counts estimated" } */
+} /* { dg-message "note: \[^\n\]*execution counts estimated" } */
 
 /* { dg-final { cleanup-coverage-files } } */
Index: gcc/testsuite/gcc.dg/pr29254.c
===================================================================
--- gcc/testsuite/gcc.dg/pr29254.c	(revision 125317)
+++ gcc/testsuite/gcc.dg/pr29254.c	(working copy)
@@ -1,8 +1,8 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -Werror" } */
-/* { dg-warning "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
 
 list_compare (int * list1)
 {
   if (list1)
     value_compare ();
@@ -16,7 +16,7 @@ value_compare (int * a)
         list_compare (a);
 }
 
 func2 (const int * fb)
 {
-  func1 ((int *) fb); /* { dg-warning "discards qualifiers" } */
+  func1 ((int *) fb); /* { dg-error "discards qualifiers" } */
 }
Index: gcc/testsuite/gcc.dg/glibc-uclibc-2.c
===================================================================
--- gcc/testsuite/gcc.dg/glibc-uclibc-2.c	(revision 125317)
+++ gcc/testsuite/gcc.dg/glibc-uclibc-2.c	(working copy)
@@ -1,6 +1,6 @@
 /* Test -mglibc and -muclibc not allowed together.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do link { target *-*-linux* } } */
 /* { dg-options "-muclibc -mglibc" } */
 
-/* { dg-error "-mglibc and -muclibc used together" "" { target *-*-* } 0 } */
+/* { dg-message "-mglibc and -muclibc used together" "" { target *-*-* } 0 } */
Index: gcc/testsuite/gcc.dg/cpp/19940712-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/19940712-1.c	(revision 125317)
+++ gcc/testsuite/gcc.dg/cpp/19940712-1.c	(working copy)
@@ -3,12 +3,12 @@
 
 /* dg.exp doesn't read the header files for magic comments. */
 /* { dg-error "unterminated comment" "" { target *-*-* } 4 } */
 /* { dg-error "unterminated comment" "header error" { target *-*-* } 8 } */
 
-#include "19940712-1.h"	  /* { dg-error "" }  // In file included from: */
-#include "19940712-1a.h"  /* { dg-error "" }  // In file included from: */
+#include "19940712-1.h"	  /* { dg-message "" }  // In file included from: */
+#include "19940712-1a.h"  /* { dg-message "" }  // In file included from: */
 #include "19940712-1b.h"
 
 /* comment start in comment error
 /* in a .c file */
 
Index: gcc/testsuite/gcc.dg/invalid-call-1.c
===================================================================
--- gcc/testsuite/gcc.dg/invalid-call-1.c	(revision 125317)
+++ gcc/testsuite/gcc.dg/invalid-call-1.c	(working copy)
@@ -11,7 +11,8 @@ extern char* mar(int n);
 char* cptr;
 
 void foo()
 {
   cptr = mar(6);
-  ((char *(*)(void *,int (*)(void *,unsigned char **),char**))((fp)bar))(0,0,(void*)(0)); /* { dg-message "" "non-compatible type" } */
+  ((char *(*)(void *,int (*)(void *,unsigned char **),char**))((fp)bar))(0,0,(void*)(0)); /* { dg-warning "function called through a non-compatible type" "non-compatible type" } */
+  /* { dg-message "note: if this code is reached, the program will abort" "" { target *-*-* } 16 } */
 }
Index: gcc/testsuite/gcc.dg/glibc-uclibc-1.c
===================================================================
--- gcc/testsuite/gcc.dg/glibc-uclibc-1.c	(revision 125317)
+++ gcc/testsuite/gcc.dg/glibc-uclibc-1.c	(working copy)
@@ -1,6 +1,6 @@
 /* Test -mglibc and -muclibc not allowed together.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do link { target *-*-linux* } } */
 /* { dg-options "-mglibc -muclibc" } */
 
-/* { dg-error "-mglibc and -muclibc used together" "" { target *-*-* } 0 } */
+/* { dg-message "-mglibc and -muclibc used together" "" { target *-*-* } 0 } */


More information about the Gcc-patches mailing list