Patchwork [testsuite] c-c++-common: make message check lines unique in test summary

login
register
mail settings
Submitter Janis Johnson
Date June 12, 2012, 2:33 a.m.
Message ID <4FD6AA62.9020304@mentor.com>
Download mbox | patch
Permalink /patch/164313/
State New
Headers show

Comments

Janis Johnson - June 12, 2012, 2:33 a.m.
This test modifies dg-error and dg-warning test directives by adding
comments that will be added to lines in the test summary to eliminate
non-unique lines for checks of messages for the same line of source code
in a test.

Tested on i686-pc-linux-gnu and arm-none-eabi.  OK for mainline?

Janis
2012-06-11  Janis Johnson  <janisjo@codesourcery.com>

	* c-c++-common/raw-string-3.c: Add comments to checks for multiple
	messages reported for for one line of source code.
	* c-c++-common/raw-string-5.c: Likewise.
	* c-c++-common/raw-string-4.c: Likewise.
	* c-c++-common/raw-string-6.c: Likewise.
	* c-c++-common/pr20000.c: Likewise.
Mike Stump - June 12, 2012, 5:02 p.m.
On Jun 11, 2012, at 7:33 PM, Janis Johnson wrote:
> This test modifies dg-error and dg-warning test directives by adding
> comments that will be added to lines in the test summary to eliminate
> non-unique lines for checks of messages for the same line of source code
> in a test.
> 
> OK for mainline?

Ok.

Patch

Index: c-c++-common/raw-string-3.c
===================================================================
--- c-c++-common/raw-string-3.c	(revision 188249)
+++ c-c++-common/raw-string-3.c	(working copy)
@@ -4,27 +4,27 @@ 
 // { dg-options "" { target c } }
 // { dg-options "-std=c++98" { target c++ } }
 
-const void	*s0	= R"(a)";	// { dg-error "was not declared|undeclared" }
-                // { dg-error "expected ',' or ';'" "" { target c } 7 }
-const void	*s1	= uR"(a)";	// { dg-error "was not declared|undeclared" }
-                // { dg-error "expected ',' or ';'" "" { target c } 9 }
-const void	*s2	= UR"(a)";	// { dg-error "was not declared|undeclared" }
-                // { dg-error "expected ',' or ';'" "" { target c } 11 }
-const void	*s3	= u8R"(a)";	// { dg-error "was not declared|undeclared" }
-                // { dg-error "expected ',' or ';'" "" { target c } 13 }
-const void	*s4	= LR"(a)";	// { dg-error "was not declared|undeclared" }
-                // { dg-error "expected ',' or ';'" "" { target c } 15 }
+const void	*s0	= R"(a)";	// { dg-error "was not declared|undeclared" "undeclared" }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 7 }
+const void	*s1	= uR"(a)";	// { dg-error "was not declared|undeclared" "undeclared" }
+                // { dg-error "expected ',' or ';'" expected" { target c } 9 }
+const void	*s2	= UR"(a)";	// { dg-error "was not declared|undeclared" "undeclared" }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 11 }
+const void	*s3	= u8R"(a)";	// { dg-error "was not declared|undeclared" "undeclared" }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 13 }
+const void	*s4	= LR"(a)";	// { dg-error "was not declared|undeclared" "undeclared" }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 15 }
 
-const int	i0	= R'a';		// { dg-error "was not declared" "" { target c++ } }
-                // { dg-error "expected ',' or ';'" "" { target c } 18 }
-const int	i1	= uR'a';	// { dg-error "was not declared" "" { target c++ } }
-                // { dg-error "expected ',' or ';'" "" { target c } 20 }
-const int	i2	= UR'a';	// { dg-error "was not declared" "" { target c++ } }
-                // { dg-error "expected ',' or ';'" "" { target c } 22 }
-const int	i3	= u8R'a';	// { dg-error "was not declared" "" { target c++ } }
-                // { dg-error "expected ',' or ';'" "" { target c } 24 }
-const int	i4	= LR'a';	// { dg-error "was not declared" "" { target c++ } }
-                // { dg-error "expected ',' or ';'" "" { target c } 26 }
+const int	i0	= R'a';		// { dg-error "was not declared" "undeclared" { target c++ } }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 18 }
+const int	i1	= uR'a';	// { dg-error "was not declared" "undeclared" { target c++ } }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 20 }
+const int	i2	= UR'a';	// { dg-error "was not declared" "undeclared" { target c++ } }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 22 }
+const int	i3	= u8R'a';	// { dg-error "was not declared" "undeclared" { target c++ } }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 24 }
+const int	i4	= LR'a';	// { dg-error "was not declared" "undeclared" { target c++ } }
+                // { dg-error "expected ',' or ';'" "expected" { target c } 26 }
 
 #define R	"a"
 #define uR	"b"
Index: c-c++-common/raw-string-5.c
===================================================================
--- c-c++-common/raw-string-5.c	(revision 188249)
+++ c-c++-common/raw-string-5.c	(working copy)
@@ -3,25 +3,25 @@ 
 // { dg-options "-std=c++0x" { target c++ } }
 
 const void *s0 = R"0123456789abcdefg()0123456789abcdefg";
-	// { dg-error "raw string delimiter longer" "" { target *-*-* } 5 }
-	// { dg-error "stray" "" { target *-*-* } 5 }
+	// { dg-error "raw string delimiter longer" "longer" { target *-*-* } 5 }
+	// { dg-error "stray" "stray" { target *-*-* } 5 }
 const void *s1 = R" () ";
-	// { dg-error "invalid character" "" { target *-*-* } 8 }
-	// { dg-error "stray" "" { target *-*-* } 8 }
+	// { dg-error "invalid character" "invalid" { target *-*-* } 8 }
+	// { dg-error "stray" "stray" { target *-*-* } 8 }
 const void *s2 = R"	()	";
-	// { dg-error "invalid character" "" { target *-*-* } 11 }
-	// { dg-error "stray" "" { target *-*-* } 11 }
+	// { dg-error "invalid character" "invalid" { target *-*-* } 11 }
+	// { dg-error "stray" "stray" { target *-*-* } 11 }
 const void *s3 = R")())";
-	// { dg-error "invalid character" "" { target *-*-* } 14 }
-	// { dg-error "stray" "" { target *-*-* } 14 }
+	// { dg-error "invalid character" "invalid" { target *-*-* } 14 }
+	// { dg-error "stray" "stray" { target *-*-* } 14 }
 const void *s4 = R"@()@";
-	// { dg-error "invalid character" "" { target *-*-* } 17 }
-	// { dg-error "stray" "" { target *-*-* } 17 }
+	// { dg-error "invalid character" "invalid" { target *-*-* } 17 }
+	// { dg-error "stray" "stray" { target *-*-* } 17 }
 const void *s5 = R"$()$";
-	// { dg-error "invalid character" "" { target *-*-* } 20 }
-	// { dg-error "stray" "" { target *-*-* } 20 }
+	// { dg-error "invalid character" "invalid" { target *-*-* } 20 }
+	// { dg-error "stray" "stray" { target *-*-* } 20 }
 const void *s6 = R"\u0040()\u0040";
-	// { dg-error "invalid character" "" { target *-*-* } 23 }
-	// { dg-error "stray" "" { target *-*-* } 23 }
+	// { dg-error "invalid character" "invalid" { target *-*-* } 23 }
+	// { dg-error "stray" "stray" { target *-*-* } 23 }
 
 int main () {}
Index: c-c++-common/raw-string-4.c
===================================================================
--- c-c++-common/raw-string-4.c	(revision 188249)
+++ c-c++-common/raw-string-4.c	(working copy)
@@ -3,16 +3,16 @@ 
 // { dg-options "-std=gnu99" { target c } }
 // { dg-options "-std=c++0x" { target c++ } }
 
-const int	i0	= R'a';	// { dg-error "was not declared|undeclared" }
-		// { dg-error "expected ',' or ';'" "" { target c } 6 }
-const int	i1	= uR'a';	// { dg-error "was not declared|undeclared" }
-		// { dg-error "expected ',' or ';'" "" { target c } 8 }
-const int	i2	= UR'a';	// { dg-error "was not declared|undeclared" }
-		// { dg-error "expected ',' or ';'" "" { target c } 10 }
-const int	i3	= u8R'a';	// { dg-error "was not declared|undeclared" }
-		// { dg-error "expected ',' or ';'" "" { target c } 12 }
-const int	i4	= LR'a';	// { dg-error "was not declared|undeclared" }
-		// { dg-error "expected ',' or ';'" "" { target c } 14 }
+const int	i0	= R'a';	// { dg-error "was not declared|undeclared" "undeclared" }
+		// { dg-error "expected ',' or ';'" "expected" { target c } 6 }
+const int	i1	= uR'a';	// { dg-error "was not declared|undeclared" "undeclared" }
+		// { dg-error "expected ',' or ';'" "expected" { target c } 8 }
+const int	i2	= UR'a';	// { dg-error "was not declared|undeclared" "undeclared" }
+		// { dg-error "expected ',' or ';'" "expected" { target c } 10 }
+const int	i3	= u8R'a';	// { dg-error "was not declared|undeclared" "undeclared" }
+		// { dg-error "expected ',' or ';'" "expected" { target c } 12 }
+const int	i4	= LR'a';	// { dg-error "was not declared|undeclared" "undeclared" }
+		// { dg-error "expected ',' or ';'" "expected" { target c } 14 }
 
 #define R	1 +
 #define uR	2 +
Index: c-c++-common/raw-string-6.c
===================================================================
--- c-c++-common/raw-string-6.c	(revision 188249)
+++ c-c++-common/raw-string-6.c	(working copy)
@@ -2,5 +2,5 @@ 
 // { dg-options "-std=gnu99" { target c } }
 // { dg-options "-std=c++0x" { target c++ } }
 
-const void *s0 = R"ouch()ouCh";	// { dg-error "at end of input" }
-	// { dg-error "unterminated raw string" "" { target *-*-* } 5 }
+const void *s0 = R"ouch()ouCh";	// { dg-error "at end of input" "end" }
+	// { dg-error "unterminated raw string" "unterminated" { target *-*-* } 5 }
Index: c-c++-common/pr20000.c
===================================================================
--- c-c++-common/pr20000.c	(revision 188249)
+++ c-c++-common/pr20000.c	(working copy)
@@ -9,8 +9,8 @@ 
 
 
 int g(void) {
-  return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */
-}           /* { dg-warning "'noreturn' function does return" "" { target *-*-* } 12 } */
+  return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "has return" } */
+}           /* { dg-warning "'noreturn' function does return" "does return" { target *-*-* } 12 } */
 
 int g2(void) {
   h();
@@ -24,8 +24,8 @@ 
 int vg2(void); /* { dg-bogus ".noreturn. function returns non-void value" } */
 
 int vg(void) {
-  return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "" { target c } 27 } */
-}           /* { dg-warning "'noreturn' function does return" "" { target c } 27  } */
+  return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "has return" { target c } 27 } */
+}           /* { dg-warning "'noreturn' function does return" "does return" { target c } 27  } */
 
 int vg2(void) {
   h();