summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-26 09:25:00 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-26 09:25:00 +0000
commitf416d8853b7574ced35abcca05bb3328173c83dd (patch)
tree7ac483f3641a0ab14ad1089216741db06cdd0e02
parent3f43053156e030186b3f33517827740220e2b9f0 (diff)
downloadgcc-f416d8853b7574ced35abcca05bb3328173c83dd.tar.gz
Replace absolute line numbers in gcc.dg
2017-05-26 Tom de Vries <tom@codesourcery.com> PR testsuite/80557 * gcc.dg/20011021-1.c: Replace absolute line numbers. * gcc.dg/Wcxx-compat-8.c: Same. * gcc.dg/Wobjsize-1.c: Same. * gcc.dg/Wshadow-local-2.c: Same. * gcc.dg/Wstrict-aliasing-converted-assigned.c: Same. * gcc.dg/anon-struct-6.c: Same. * gcc.dg/asm-wide-1.c: Same. * gcc.dg/builtin-inf-1.c: Same. * gcc.dg/builtin-redefine.c: Same. * gcc.dg/c90-array-lval-6.c: Same. * gcc.dg/c90-array-lval-7.c: Same. * gcc.dg/c90-fordecl-1.c: Same. * gcc.dg/c99-fordecl-2.c: Same. * gcc.dg/cast-lvalue-1.c: Same. * gcc.dg/cast-lvalue-2.c: Same. * gcc.dg/compound-lvalue-1.c: Same. * gcc.dg/cond-lvalue-1.c: Same. * gcc.dg/cpp/20000419-1.c: Same. * gcc.dg/cpp/backslash.c: Same. * gcc.dg/cpp/backslash2.c: Same. * gcc.dg/cpp/macspace1.c: Same. * gcc.dg/cpp/macspace2.c: Same. * gcc.dg/cpp/multiline-2.c: Same. * gcc.dg/cpp/pr27777.c: Same. * gcc.dg/cpp/pr30786.c: Same. * gcc.dg/cpp/pr34602.c: Same. * gcc.dg/cpp/redef1.c: Same. * gcc.dg/cpp/tr-warn1.c: Same. * gcc.dg/cpp/tr-warn3.c: Same. * gcc.dg/cpp/tr-warn6.c: Same. * gcc.dg/cpp/trad/hash.c: Same. * gcc.dg/cpp/trad/redef1.c: Same. * gcc.dg/cpp/ucs.c: Same. * gcc.dg/declspec-10.c: Same. * gcc.dg/declspec-11.c: Same. * gcc.dg/declspec-18.c: Same. * gcc.dg/format/c99-strftime-1.c: Same. * gcc.dg/format/ext-3.c: Same. * gcc.dg/format/pr72858.c: Same. * gcc.dg/gomp/appendix-a/a.24.1.c: Same. * gcc.dg/init-string-1.c: Same. * gcc.dg/label-decl-3.c: Same. * gcc.dg/m-un-2.c: Same. * gcc.dg/nofixed-point-2.c: Same. * gcc.dg/noncompile/20020213-1.c: Same. * gcc.dg/pch/counter-2.c: Same. * gcc.dg/plugin/diagnostic-test-string-literals-2.c: Same. * gcc.dg/pr27528.c: Same. * gcc.dg/pr27953.c: Same. * gcc.dg/pr35899.c: Same. * gcc.dg/pr37561.c: Same. * gcc.dg/pr45461.c: Same. * gcc.dg/pr45750.c: Same. * gcc.dg/pr53196-2.c: Same. * gcc.dg/pr53265.c: Same. * gcc.dg/redecl-1.c: Same. * gcc.dg/tls/thr-init-1.c: Same. * gcc.dg/torture/pr51106-1.c: Same. * gcc.dg/torture/pr51106-2.c: Same. * gcc.dg/uninit-19.c: Same. * gcc.dg/uninit-pr20644.c: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248484 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog65
-rw-r--r--gcc/testsuite/gcc.dg/20011021-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/Wcxx-compat-8.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wobjsize-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wshadow-local-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c9
-rw-r--r--gcc/testsuite/gcc.dg/anon-struct-6.c4
-rw-r--r--gcc/testsuite/gcc.dg/asm-wide-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/builtin-inf-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/builtin-redefine.c12
-rw-r--r--gcc/testsuite/gcc.dg/c90-array-lval-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/c90-array-lval-7.c3
-rw-r--r--gcc/testsuite/gcc.dg/c90-fordecl-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/c99-fordecl-2.c16
-rw-r--r--gcc/testsuite/gcc.dg/cast-lvalue-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/cast-lvalue-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/compound-lvalue-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/cond-lvalue-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/20000419-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/backslash.c9
-rw-r--r--gcc/testsuite/gcc.dg/cpp/backslash2.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/macspace1.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/macspace2.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/multiline-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr27777.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr30786.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr34602.c3
-rw-r--r--gcc/testsuite/gcc.dg/cpp/redef1.c19
-rw-r--r--gcc/testsuite/gcc.dg/cpp/tr-warn1.c9
-rw-r--r--gcc/testsuite/gcc.dg/cpp/tr-warn3.c9
-rw-r--r--gcc/testsuite/gcc.dg/cpp/tr-warn6.c3
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/hash.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/redef1.c33
-rw-r--r--gcc/testsuite/gcc.dg/cpp/ucs.c2
-rw-r--r--gcc/testsuite/gcc.dg/declspec-10.c7
-rw-r--r--gcc/testsuite/gcc.dg/declspec-11.c7
-rw-r--r--gcc/testsuite/gcc.dg/declspec-18.c44
-rw-r--r--gcc/testsuite/gcc.dg/format/c99-strftime-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/format/ext-3.c48
-rw-r--r--gcc/testsuite/gcc.dg/format/pr72858.c8
-rw-r--r--gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c6
-rw-r--r--gcc/testsuite/gcc.dg/init-string-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/label-decl-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/m-un-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/nofixed-point-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/20020213-1.c27
-rw-r--r--gcc/testsuite/gcc.dg/pch/counter-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr27528.c13
-rw-r--r--gcc/testsuite/gcc.dg/pr27953.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr35899.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr37561.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr45461.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr45750.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr53196-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr53265.c5
-rw-r--r--gcc/testsuite/gcc.dg/redecl-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/tls/thr-init-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr51106-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr51106-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-19.c9
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr20644.c3
62 files changed, 323 insertions, 216 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4f73955c6f6..b2fc5b6d8b1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,68 @@
+2017-05-26 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/80557
+ * gcc.dg/20011021-1.c: Replace absolute line numbers.
+ * gcc.dg/Wcxx-compat-8.c: Same.
+ * gcc.dg/Wobjsize-1.c: Same.
+ * gcc.dg/Wshadow-local-2.c: Same.
+ * gcc.dg/Wstrict-aliasing-converted-assigned.c: Same.
+ * gcc.dg/anon-struct-6.c: Same.
+ * gcc.dg/asm-wide-1.c: Same.
+ * gcc.dg/builtin-inf-1.c: Same.
+ * gcc.dg/builtin-redefine.c: Same.
+ * gcc.dg/c90-array-lval-6.c: Same.
+ * gcc.dg/c90-array-lval-7.c: Same.
+ * gcc.dg/c90-fordecl-1.c: Same.
+ * gcc.dg/c99-fordecl-2.c: Same.
+ * gcc.dg/cast-lvalue-1.c: Same.
+ * gcc.dg/cast-lvalue-2.c: Same.
+ * gcc.dg/compound-lvalue-1.c: Same.
+ * gcc.dg/cond-lvalue-1.c: Same.
+ * gcc.dg/cpp/20000419-1.c: Same.
+ * gcc.dg/cpp/backslash.c: Same.
+ * gcc.dg/cpp/backslash2.c: Same.
+ * gcc.dg/cpp/macspace1.c: Same.
+ * gcc.dg/cpp/macspace2.c: Same.
+ * gcc.dg/cpp/multiline-2.c: Same.
+ * gcc.dg/cpp/pr27777.c: Same.
+ * gcc.dg/cpp/pr30786.c: Same.
+ * gcc.dg/cpp/pr34602.c: Same.
+ * gcc.dg/cpp/redef1.c: Same.
+ * gcc.dg/cpp/tr-warn1.c: Same.
+ * gcc.dg/cpp/tr-warn3.c: Same.
+ * gcc.dg/cpp/tr-warn6.c: Same.
+ * gcc.dg/cpp/trad/hash.c: Same.
+ * gcc.dg/cpp/trad/redef1.c: Same.
+ * gcc.dg/cpp/ucs.c: Same.
+ * gcc.dg/declspec-10.c: Same.
+ * gcc.dg/declspec-11.c: Same.
+ * gcc.dg/declspec-18.c: Same.
+ * gcc.dg/format/c99-strftime-1.c: Same.
+ * gcc.dg/format/ext-3.c: Same.
+ * gcc.dg/format/pr72858.c: Same.
+ * gcc.dg/gomp/appendix-a/a.24.1.c: Same.
+ * gcc.dg/init-string-1.c: Same.
+ * gcc.dg/label-decl-3.c: Same.
+ * gcc.dg/m-un-2.c: Same.
+ * gcc.dg/nofixed-point-2.c: Same.
+ * gcc.dg/noncompile/20020213-1.c: Same.
+ * gcc.dg/pch/counter-2.c: Same.
+ * gcc.dg/plugin/diagnostic-test-string-literals-2.c: Same.
+ * gcc.dg/pr27528.c: Same.
+ * gcc.dg/pr27953.c: Same.
+ * gcc.dg/pr35899.c: Same.
+ * gcc.dg/pr37561.c: Same.
+ * gcc.dg/pr45461.c: Same.
+ * gcc.dg/pr45750.c: Same.
+ * gcc.dg/pr53196-2.c: Same.
+ * gcc.dg/pr53265.c: Same.
+ * gcc.dg/redecl-1.c: Same.
+ * gcc.dg/tls/thr-init-1.c: Same.
+ * gcc.dg/torture/pr51106-1.c: Same.
+ * gcc.dg/torture/pr51106-2.c: Same.
+ * gcc.dg/uninit-19.c: Same.
+ * gcc.dg/uninit-pr20644.c: Same.
+
2017-05-26 Jakub Jelinek <jakub@redhat.com>
* g++.dg/cpp1z/decomp29.C (p): New variable.
diff --git a/gcc/testsuite/gcc.dg/20011021-1.c b/gcc/testsuite/gcc.dg/20011021-1.c
index 8893b774aa3..2d567a75381 100644
--- a/gcc/testsuite/gcc.dg/20011021-1.c
+++ b/gcc/testsuite/gcc.dg/20011021-1.c
@@ -24,7 +24,7 @@ struct multilevel
struct t t;
union u u;
union u v;
- char *f;
+ char *f; /* { dg-line multilevel_f } */
};
struct t T0 = { 1 }; /* { dg-warning "missing init" } */
@@ -42,4 +42,4 @@ struct multilevel M =
{ .n = 9 }, /* { dg-bogus "initialization of union" } */
/* "string here" */
}; /* { dg-warning "missing init" } */
-/* { dg-message "declared here" "near init" { target *-*-* } 27 } */
+/* { dg-message "declared here" "near init" { target *-*-* } multilevel_f } */
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-8.c b/gcc/testsuite/gcc.dg/Wcxx-compat-8.c
index 85ccec7989f..9627dced347 100644
--- a/gcc/testsuite/gcc.dg/Wcxx-compat-8.c
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-8.c
@@ -63,6 +63,5 @@ void *
f5 ()
{
return &((struct t8) { }); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ /* { dg-error "invalid use of undefined type" "" { target *-*-* } .-1 } */
}
-
-/* { dg-error "invalid use of undefined type" "" { target *-*-* } 65 } */
diff --git a/gcc/testsuite/gcc.dg/Wobjsize-1.c b/gcc/testsuite/gcc.dg/Wobjsize-1.c
index 211e0680a1d..19c7e68e010 100644
--- a/gcc/testsuite/gcc.dg/Wobjsize-1.c
+++ b/gcc/testsuite/gcc.dg/Wobjsize-1.c
@@ -4,12 +4,13 @@
#include "Wobjsize-1.h"
char buf[6];
+/* { dg-warning "writing" "" { target *-*-* } .-1 } */
+
int main(int argc, char **argv)
{
strcpy (buf,"hello ");
return 0;
}
-/* { dg-warning "writing" "" { target *-*-* } 6 } */
/* { dg-message "file included" "included" { target *-*-* } 0 } */
/* { dg-message "inlined from" "inlined" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/Wshadow-local-2.c b/gcc/testsuite/gcc.dg/Wshadow-local-2.c
index 8f6b132f66d..55ff978a12f 100644
--- a/gcc/testsuite/gcc.dg/Wshadow-local-2.c
+++ b/gcc/testsuite/gcc.dg/Wshadow-local-2.c
@@ -40,10 +40,11 @@ int func3() {
void func4() {
struct Bar bar; /* { dg-message "shadowed declaration" } */
+ /* { dg-bogus "shadows a global" "" { target *-*-* } .-1 } */
+
if (val) {
int bar; /* { dg-warning "shadows a previous local" } */
func1(bar);
}
}
-/* { dg-bogus "shadows a global" "" { target *-*-* } 42 } */
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
index 06a8a376b8b..c44fc429a11 100644
--- a/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
@@ -6,10 +6,9 @@ int foo()
{
int i;
*(long*)&i = 0; /* { dg-warning "type-punn" "type-punn" } */
+ /* These messages are only expected for lp64, but fail there. When they
+ pass for lp64, replace "xfail *-*-*" with "target lp64". */
+ /* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } .-3 } */
+ /* { dg-message "initialized" "init" { xfail *-*-* } .-4 } */
return i;
}
-
-/* These messages are only expected for lp64, but fail there. When they
- pass for lp64, replace "xfail *-*-*" with "target lp64". */
-/* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } 8 } */
-/* { dg-message "initialized" "init" { xfail *-*-* } 8 } */
diff --git a/gcc/testsuite/gcc.dg/anon-struct-6.c b/gcc/testsuite/gcc.dg/anon-struct-6.c
index 8ce14f48474..792769b8868 100644
--- a/gcc/testsuite/gcc.dg/anon-struct-6.c
+++ b/gcc/testsuite/gcc.dg/anon-struct-6.c
@@ -7,6 +7,6 @@
struct s {
int a;
const;
+ /* { dg-warning "useless type qualifier in empty declaration" "empty" { target *-*-* } .-1 } */
+ /* { dg-warning "empty declaration" "empty 2" { target *-*-* } .-2 } */
};
-/* { dg-warning "useless type qualifier in empty declaration" "empty" { target *-*-* } 9 } */
-/* { dg-warning "empty declaration" "empty 2" { target *-*-* } 9 } */
diff --git a/gcc/testsuite/gcc.dg/asm-wide-1.c b/gcc/testsuite/gcc.dg/asm-wide-1.c
index c14b19d3479..88bbaed7f16 100644
--- a/gcc/testsuite/gcc.dg/asm-wide-1.c
+++ b/gcc/testsuite/gcc.dg/asm-wide-1.c
@@ -14,10 +14,14 @@ f (void)
asm (L"foo"); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" :
L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
+ /* Extra errors from the substitution of "" for wide strings: */
+ /* { dg-error "output" "output" { target *-*-* } .-2 } */
asm ("foo" : [x]
L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
+ /* { dg-error "output" "output" { target *-*-* } .-1 } */
asm ("foo" : [x] "=g" (x),
L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
+ /* { dg-error "output" "output" { target *-*-* } .-1 } */
asm ("foo" : :
L"g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" : : :
@@ -25,8 +29,3 @@ f (void)
asm ("foo" : : : "memory",
L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */
}
-
-/* Extra errors from the substitution of "" for wide strings: */
-/* { dg-error "output" "output" { target *-*-* } 16 } */
-/* { dg-error "output" "output" { target *-*-* } 18 } */
-/* { dg-error "output" "output" { target *-*-* } 20 } */
diff --git a/gcc/testsuite/gcc.dg/builtin-inf-1.c b/gcc/testsuite/gcc.dg/builtin-inf-1.c
index d96a5b6b3f5..1e00bdc0761 100644
--- a/gcc/testsuite/gcc.dg/builtin-inf-1.c
+++ b/gcc/testsuite/gcc.dg/builtin-inf-1.c
@@ -1,13 +1,13 @@
/* { dg-do compile } */
float fi = __builtin_inff();
+/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* spu-*-* } .-1 } */
double di = __builtin_inf();
+/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } .-1 } */
long double li = __builtin_infl();
+/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } .-1 } */
float fh = __builtin_huge_valf();
double dh = __builtin_huge_val();
long double lh = __builtin_huge_vall();
-/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* spu-*-* } 3 } */
-/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } 4 } */
-/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } 5 } */
diff --git a/gcc/testsuite/gcc.dg/builtin-redefine.c b/gcc/testsuite/gcc.dg/builtin-redefine.c
index 9b21afdd669..8090015f693 100644
--- a/gcc/testsuite/gcc.dg/builtin-redefine.c
+++ b/gcc/testsuite/gcc.dg/builtin-redefine.c
@@ -25,10 +25,10 @@
#undef __TIME__ /* Undefine while already undefined. */
#define __TIME__ "X" /* Define while undefined. */
-#define __TIME__ "X" /* Re-define while defined. */
+#define __TIME__ "X" /* Re-define while defined. */ /* { dg-line time_prev } */
#define __TIME__ "Y" /* { dg-warning "\"__TIME__\" redefined" } */
-/* { dg-message "previous definition" "" { target *-*-* } 28 } */
+/* { dg-message "previous definition" "" { target *-*-* } time_prev } */
#undef __TIME__ /* Undefine while defined. */
@@ -36,19 +36,19 @@
#undef __DATE__ /* Undefine while already undefined. */
#define __DATE__ "X" /* Define while undefined. */
-#define __DATE__ "X" /* Re-define while defined. */
+#define __DATE__ "X" /* Re-define while defined. */ /* { dg-line date_prev } */
#define __DATE__ "Y" /* { dg-warning "\"__DATE__\" redefined" } */
-/* { dg-message "previous definition" "" { target *-*-* } 39 } */
+/* { dg-message "previous definition" "" { target *-*-* } date_prev } */
#undef __DATE__ /* Undefine while defined. */
#define __TIMESTAMP__ "X" /* Define while already defined. */
-#define __TIMESTAMP__ "X" /* Re-define while defined. */
+#define __TIMESTAMP__ "X" /* Re-define while defined. */ /* { dg-line timestamp_prev } */
#define __TIMESTAMP__ "Y" /* { dg-warning "\"__TIMESTAMP__\" redefined" } */
-/* { dg-message "previous definition" "" { target *-*-* } 48 } */
+/* { dg-message "previous definition" "" { target *-*-* } timestamp_prev } */
#undef __TIMESTAMP__ /* Undefine while defined. */
diff --git a/gcc/testsuite/gcc.dg/c90-array-lval-6.c b/gcc/testsuite/gcc.dg/c90-array-lval-6.c
index f42ef52bd19..dc57ed70774 100644
--- a/gcc/testsuite/gcc.dg/c90-array-lval-6.c
+++ b/gcc/testsuite/gcc.dg/c90-array-lval-6.c
@@ -12,5 +12,5 @@ extern struct s foo(void);
void bar(void)
{
char *ptr = foo().c; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } .-1 } */
}
-/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 14 } */
diff --git a/gcc/testsuite/gcc.dg/c90-array-lval-7.c b/gcc/testsuite/gcc.dg/c90-array-lval-7.c
index ee8da4c70fd..9b41777a15b 100644
--- a/gcc/testsuite/gcc.dg/c90-array-lval-7.c
+++ b/gcc/testsuite/gcc.dg/c90-array-lval-7.c
@@ -18,6 +18,5 @@ bar (void)
6.3.15 does not permit conditional expressions between arrays.
In C99, they decay to pointers. */
(e ? (d ? b : c).c : (e ? b : c).c); /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "array" "bad conditional" { target *-*-* } .-1 } */
}
-
-/* { dg-error "array" "bad conditional" { target *-*-* } 20 } */
diff --git a/gcc/testsuite/gcc.dg/c90-fordecl-1.c b/gcc/testsuite/gcc.dg/c90-fordecl-1.c
index 51e82ff7e94..0fb9b202df1 100644
--- a/gcc/testsuite/gcc.dg/c90-fordecl-1.c
+++ b/gcc/testsuite/gcc.dg/c90-fordecl-1.c
@@ -8,7 +8,7 @@ foo (void)
{
int j = 0;
for (int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "'for' loop initial declarations are only allowed in C99 or C11 mode" "declaration in for loop" { target *-*-* } .-1 } */
+ /* { dg-message "note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code" "note" { target *-*-* } .-2 }} */
j += i;
- /* { dg-error "'for' loop initial declarations are only allowed in C99 or C11 mode" "declaration in for loop" { target *-*-* } 10 } */
- /* { dg-message "note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code" "note" { target *-*-* } 10 }} */
}
diff --git a/gcc/testsuite/gcc.dg/c99-fordecl-2.c b/gcc/testsuite/gcc.dg/c99-fordecl-2.c
index 0ef11f61225..aa5bc783ff8 100644
--- a/gcc/testsuite/gcc.dg/c99-fordecl-2.c
+++ b/gcc/testsuite/gcc.dg/c99-fordecl-2.c
@@ -10,19 +10,23 @@ foo (void)
behind these tests. */
int j = 0;
for (int i = 1, bar (void); i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "bar" "function in for loop" { target *-*-* } .-1 } */
j += i;
- /* { dg-error "bar" "function in for loop" { target *-*-* } 12 } */
+
for (static int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "static" "static in for loop" { target *-*-* } .-1 } */
j += i;
- /* { dg-error "static" "static in for loop" { target *-*-* } 15 } */
+
for (extern int i; j <= 500; j++) /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "extern" "extern in for loop" { target *-*-* } .-1 } */
j += 5;
- /* { dg-error "extern" "extern in for loop" { target *-*-* } 18 } */
+
for (enum { FOO } i = FOO; i < 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "FOO" "enum value in for loop" { target *-*-* } .-1 } */
j += i;
- /* { dg-error "FOO" "enum value in for loop" { target *-*-* } 21 } */
+
for (enum BAR { FOO } i = FOO; i < 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "FOO" "enum value in for loop" { target *-*-* } .-1 } */
+ /* { dg-error "BAR" "enum tag in for loop" { target *-*-* } .-2 } */
j += i;
- /* { dg-error "FOO" "enum value in for loop" { target *-*-* } 24 } */
- /* { dg-error "BAR" "enum tag in for loop" { target *-*-* } 24 } */
}
diff --git a/gcc/testsuite/gcc.dg/cast-lvalue-1.c b/gcc/testsuite/gcc.dg/cast-lvalue-1.c
index 4e84804e66d..ef3ae0a4db1 100644
--- a/gcc/testsuite/gcc.dg/cast-lvalue-1.c
+++ b/gcc/testsuite/gcc.dg/cast-lvalue-1.c
@@ -9,5 +9,5 @@ void
foo (void)
{
(char) x = 1; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "lvalue" "cast as lvalue" { target *-*-* } .-1 } */
}
-/* { dg-error "lvalue" "cast as lvalue" { target *-*-* } 11 } */
diff --git a/gcc/testsuite/gcc.dg/cast-lvalue-2.c b/gcc/testsuite/gcc.dg/cast-lvalue-2.c
index d4db4bd6ff3..0dcbedc7c23 100644
--- a/gcc/testsuite/gcc.dg/cast-lvalue-2.c
+++ b/gcc/testsuite/gcc.dg/cast-lvalue-2.c
@@ -9,5 +9,5 @@ void
foo (void)
{
(int) x = 1; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "lvalue" "cast as lvalue" { target *-*-* } .-1 } */
}
-/* { dg-error "lvalue" "cast as lvalue" { target *-*-* } 11 } */
diff --git a/gcc/testsuite/gcc.dg/compound-lvalue-1.c b/gcc/testsuite/gcc.dg/compound-lvalue-1.c
index 30ed58ff8a1..ffff76e47a4 100644
--- a/gcc/testsuite/gcc.dg/compound-lvalue-1.c
+++ b/gcc/testsuite/gcc.dg/compound-lvalue-1.c
@@ -9,5 +9,5 @@ void
foo (void)
{
(x, y) = 1; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "lvalue" "compound expression as lvalue" { target *-*-* } .-1 } */
}
-/* { dg-error "lvalue" "compound expression as lvalue" { target *-*-* } 11 } */
diff --git a/gcc/testsuite/gcc.dg/cond-lvalue-1.c b/gcc/testsuite/gcc.dg/cond-lvalue-1.c
index f2605af6ad6..d7995c7eda5 100644
--- a/gcc/testsuite/gcc.dg/cond-lvalue-1.c
+++ b/gcc/testsuite/gcc.dg/cond-lvalue-1.c
@@ -9,5 +9,5 @@ void
foo (void)
{
(x ? y : z) = 1; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } .-1 } */
}
-/* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } 11 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/20000419-1.c b/gcc/testsuite/gcc.dg/cpp/20000419-1.c
index c4400ee6ce2..c2373163990 100644
--- a/gcc/testsuite/gcc.dg/cpp/20000419-1.c
+++ b/gcc/testsuite/gcc.dg/cpp/20000419-1.c
@@ -10,6 +10,5 @@
__REDIRECT (a, b, c)
__ASMNAME2 (__USER_LABEL_PREFIX__, harumph)
-
-/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 11 } */
-/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 12 } */
+/* { dg-bogus "used without args" "no args, 1" { target *-*-* } .-2 } */
+/* { dg-bogus "used without args" "no args, 1" { target *-*-* } .-2 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/backslash.c b/gcc/testsuite/gcc.dg/cpp/backslash.c
index f1b094a0b84..3255a6a5f9d 100644
--- a/gcc/testsuite/gcc.dg/cpp/backslash.c
+++ b/gcc/testsuite/gcc.dg/cpp/backslash.c
@@ -5,16 +5,15 @@
b, \
c
-/* Note the trailing whitespace on the next three lines. */
+/* Note the trailing whitespace on the first three lines of beta def. */
+/* { dg-warning "separated by space" "space" { target *-*-* } .+3 } */
+/* { dg-warning "separated by space" "tab" { target *-*-* } .+3 } */
+/* { dg-warning "separated by space" "space and tab" { target *-*-* } .+3 } */
#define beta(a, b, c) \
a, \
b, \
c
-/* { dg-warning "separated by space" "space" { target *-*-* } 9 } */
-/* { dg-warning "separated by space" "tab" { target *-*-* } 10 } */
-/* { dg-warning "separated by space" "space and tab" { target *-*-* } 11 } */
-
int x[] = {
alpha(1, 2, 3),
beta(4, 5, 6)
diff --git a/gcc/testsuite/gcc.dg/cpp/backslash2.c b/gcc/testsuite/gcc.dg/cpp/backslash2.c
index 65142d9309d..5c10e868107 100644
--- a/gcc/testsuite/gcc.dg/cpp/backslash2.c
+++ b/gcc/testsuite/gcc.dg/cpp/backslash2.c
@@ -7,8 +7,8 @@
foo \
bar
-/* { dg-warning "separated by space" "" { target *-*-* } 8 } */
+/* { dg-warning "separated by space" "" { target *-*-* } .-2 } */
/* foo \
bar */
-/* { dg-bogus "separated by space" "" { target *-*-* } 12 } */
+/* { dg-bogus "separated by space" "" { target *-*-* } .-2 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/macspace1.c b/gcc/testsuite/gcc.dg/cpp/macspace1.c
index d8578448b64..b920f892ac5 100644
--- a/gcc/testsuite/gcc.dg/cpp/macspace1.c
+++ b/gcc/testsuite/gcc.dg/cpp/macspace1.c
@@ -4,10 +4,12 @@
#define a! /* { dg-warning "missing whitespace" } */
#define b" /* { dg-warning "missing whitespace" } */
+/* { dg-error "missing terminating" "" { target *-*-* } .-1 } */
#define c# /* { dg-warning "missing whitespace" } */
#define d% /* { dg-warning "missing whitespace" } */
#define e& /* { dg-warning "missing whitespace" } */
#define f' /* { dg-warning "missing whitespace" } */
+/* { dg-error "missing terminating" "" { target *-*-* } .-1 } */
#define g) /* { dg-warning "missing whitespace" } */
#define h* /* { dg-warning "missing whitespace" } */
#define i+ /* { dg-warning "missing whitespace" } */
@@ -59,5 +61,3 @@
#define ag"abc" /* { dg-warning "missing whitespace" } */
int dummy;
-/* { dg-error "missing terminating" "" { target *-*-* } 6 } */
-/* { dg-error "missing terminating" "" { target *-*-* } 10 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/macspace2.c b/gcc/testsuite/gcc.dg/cpp/macspace2.c
index 6e6be96b1ff..87716d6d43c 100644
--- a/gcc/testsuite/gcc.dg/cpp/macspace2.c
+++ b/gcc/testsuite/gcc.dg/cpp/macspace2.c
@@ -4,10 +4,12 @@
#define a! /* { dg-error "requires whitespace" } */
#define b" /* { dg-error "requires whitespace" } */
+/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } .-1 } */
#define c# /* { dg-error "requires whitespace" } */
#define d% /* { dg-error "requires whitespace" } */
#define e& /* { dg-error "requires whitespace" } */
#define f' /* { dg-error "requires whitespace" } */
+/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } .-1 } */
#define g) /* { dg-error "requires whitespace" } */
#define h* /* { dg-error "requires whitespace" } */
#define i+ /* { dg-error "requires whitespace" } */
@@ -59,5 +61,3 @@
#define ag"abc" /* { dg-error "requires whitespace" } */
int dummy;
-/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 6 } */
-/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 10 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/multiline-2.c b/gcc/testsuite/gcc.dg/cpp/multiline-2.c
index 2841e00fb3b..6ffeb2a8f68 100644
--- a/gcc/testsuite/gcc.dg/cpp/multiline-2.c
+++ b/gcc/testsuite/gcc.dg/cpp/multiline-2.c
@@ -8,7 +8,6 @@
const char *p = "line 1
"
""; /* The compiler front end sees this. */
-
-/* { dg-error "17:missing term" "multiline strings" { target *-*-* } 8 } */
-/* { dg-error "missing term" "multiline strings" { target *-*-* } 9 } */
+/* { dg-error "17:missing term" "multiline strings" { target *-*-* } .-3 } */
+/* { dg-error "missing term" "multiline strings" { target *-*-* } .-3 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/pr27777.c b/gcc/testsuite/gcc.dg/cpp/pr27777.c
index 89258b95e9f..50e2459591c 100644
--- a/gcc/testsuite/gcc.dg/cpp/pr27777.c
+++ b/gcc/testsuite/gcc.dg/cpp/pr27777.c
@@ -3,6 +3,5 @@
/* { dg-options { -trigraphs -Wall } } */
#error "BUG??!"
-
-/* { dg-error "BUG" "" { target *-*-* } 5 } */
-/* { dg-warning "trigraph" "" { target *-*-* } 5 } */
+/* { dg-error "BUG" "" { target *-*-* } .-1 } */
+/* { dg-warning "trigraph" "" { target *-*-* } .-2 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/pr30786.c b/gcc/testsuite/gcc.dg/cpp/pr30786.c
index 2c3610847fd..5bcccda0a21 100644
--- a/gcc/testsuite/gcc.dg/cpp/pr30786.c
+++ b/gcc/testsuite/gcc.dg/cpp/pr30786.c
@@ -1,9 +1,8 @@
/* PR preprocessor/30786 - _Pragma at end of file should not ICE */
/* { dg-do compile } */
-/* { dg-error "parenthesized" "parenthesized" { target *-*-* } 9 } */
-/* { dg-error "expected" "expected" { target *-*-* } 9 } */
-
int x;
+/* { dg-error "parenthesized" "parenthesized" { target *-*-* } .+2 } */
+/* { dg-error "expected" "expected" { target *-*-* } .+1 } */
_Pragma
diff --git a/gcc/testsuite/gcc.dg/cpp/pr34602.c b/gcc/testsuite/gcc.dg/cpp/pr34602.c
index 343c0917aee..eb24ead8422 100644
--- a/gcc/testsuite/gcc.dg/cpp/pr34602.c
+++ b/gcc/testsuite/gcc.dg/cpp/pr34602.c
@@ -1,6 +1,5 @@
/* PR preprocessor/34602 - no internal error trying to spell EOF. */
/* { dg-do preprocess } */
-/* { dg-error "unexpected end" "" { target *-*-* } 6 } */
-
+/* { dg-error "unexpected end" "" { target *-*-* } .+1 } */
#line
diff --git a/gcc/testsuite/gcc.dg/cpp/redef1.c b/gcc/testsuite/gcc.dg/cpp/redef1.c
index a5fe2bacc53..2b5304cb8b9 100644
--- a/gcc/testsuite/gcc.dg/cpp/redef1.c
+++ b/gcc/testsuite/gcc.dg/cpp/redef1.c
@@ -5,15 +5,14 @@
#define foo bar
#define /* x */ foo /* x */ bar /* x */
+/* { dg-bogus "redefined" "foo redefined" { target *-*-* } .-1 } */
+/* { dg-bogus "previous def" "foo prev def" { target *-*-* } .-3 } */
-#define quux(thud) a one and a thud and a two
-#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two
-#define quux(thud) a one and a thud and a two /* bah */
+#define quux(thud) a one and a thud and a two /* { dg-line quux_def_1 } */
+#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two /* { dg-line quux_def_2 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_2 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_1 } */
-/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 7 } */
-/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 10 } */
-/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */
-
-/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 6 } */
-/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 9 } */
-/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */
+#define quux(thud) a one and a thud and a two /* bah */ /* { dg-line quux_def_3 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_3 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_2 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn1.c b/gcc/testsuite/gcc.dg/cpp/tr-warn1.c
index 37b5efe5df1..20fe44e857c 100644
--- a/gcc/testsuite/gcc.dg/cpp/tr-warn1.c
+++ b/gcc/testsuite/gcc.dg/cpp/tr-warn1.c
@@ -20,9 +20,13 @@
_and_ they should get a -pedantic warning. */
#assert foo(bar) /* { dg-warning "indented" "^#ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
# assert bar(baz) /* { dg-warning "indented" "^# ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
#assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
# assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
/* We warn of #elif regardless of whether we're skipping or not, and
do not warn about indentaion. */
@@ -32,8 +36,3 @@
#endif
#elif 0 /* { dg-warning "#elif" "#elif not skipping" } */
#endif
-
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 22 } */
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 23 } */
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 24 } */
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 25 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn3.c b/gcc/testsuite/gcc.dg/cpp/tr-warn3.c
index 33517188cd8..85b70144147 100644
--- a/gcc/testsuite/gcc.dg/cpp/tr-warn3.c
+++ b/gcc/testsuite/gcc.dg/cpp/tr-warn3.c
@@ -25,9 +25,13 @@
they should get a -pedantic warning. */
#assert foo(bar) /* { dg-warning "indented" "^#ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
# assert bar(baz) /* { dg-warning "indented" "^# ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
#assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
# assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */
#else
@@ -54,8 +58,3 @@
# unassert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */
#endif
-
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 27 } */
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 28 } */
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 29 } */
-/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 30 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn6.c b/gcc/testsuite/gcc.dg/cpp/tr-warn6.c
index d95409ef8f9..137064eba3f 100644
--- a/gcc/testsuite/gcc.dg/cpp/tr-warn6.c
+++ b/gcc/testsuite/gcc.dg/cpp/tr-warn6.c
@@ -11,9 +11,8 @@
#define foo5(h2) sdf 'h2' fds 'h3' /* { dg-warning "macro argument \"h2\" would be stringified" "traditional stringification" } */
#define foo6(h3) sdf 'h2' fds 'h3' /* { dg-warning "macro argument \"h3\" would be stringified" "traditional stringification" } */
#define foo7(AA, hello, world, EEE) sdf "A B hello C,world,DhelloE F" fds EEE /* { dg-warning "macro argument \"hello\" would be stringified" "traditional stringification" } */
-
/* Catch the second warning from the above line. */
-/* { dg-warning "macro argument \"world\" would be stringified" "traditional stringification second warning" { target *-*-* } 13 } */
+/* { dg-warning "macro argument \"world\" would be stringified" "traditional stringification second warning" { target *-*-* } .-2 } */
# 19 "sys-header.h" 3
/* We are in system headers now, no -Wtraditional warnings should issue. */
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/hash.c b/gcc/testsuite/gcc.dg/cpp/trad/hash.c
index 8108c89fbfc..4ddd9654c3b 100644
--- a/gcc/testsuite/gcc.dg/cpp/trad/hash.c
+++ b/gcc/testsuite/gcc.dg/cpp/trad/hash.c
@@ -5,10 +5,9 @@
#ifndef foo
#define foo /**/
#endif
+/* { dg-bogus "(start|end) of macro" "paste at end" { target *-*-* } .-1 } */
#ifndef foo
#define foo /* as nothing */
#endif
-
-/* { dg-bogus "(start|end) of macro" "paste at end" { target *-*-* } 7 } */
-/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } 11 } */
+/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/redef1.c b/gcc/testsuite/gcc.dg/cpp/trad/redef1.c
index ce5dde0bb37..ba175698024 100644
--- a/gcc/testsuite/gcc.dg/cpp/trad/redef1.c
+++ b/gcc/testsuite/gcc.dg/cpp/trad/redef1.c
@@ -6,31 +6,30 @@
#define foo bar
#define /* x */ foo /* x */ bar /* x */
+/* { dg-bogus "redefined" "foo redefined" { target *-*-* } .-1 } */
+/* { dg-bogus "previous def" "foo prev def" { target *-*-* } .-3 } */
-#define quux(thud) a one and a thud and a two
-#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two
-#define quux(thud) a one and a thud and a two /* bah */
+#define quux(thud) a one and a thud and a two /* { dg-line quux_def_1 } */
+#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two /* { dg-line quux_def_2 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_2 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_1 } */
+
+#define quux(thud) a one and a thud and a two /* bah */ /* { dg-line quux_def_3 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_3 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_2 } */
#define f(x, y)x "x y z" y
#define f(x, y) x "x y z" y
+/* { dg-bogus "redefined" "f redefined" { target *-*-* } .-1 } */
+/* { dg-bogus "previous def" "f prev def" { target *-*-* } .-3 } */
#define baz() whiz bang
#define baz() whiz bang
+/* { dg-bogus "redefined" "baz redefined" { target *-*-* } .-1 } */
+/* { dg-bogus "previous def" "baz prev def" { target *-*-* } .-3 } */
#define g foo
#undef g
#define g
-
-/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 8 } */
-/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */
-/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 12 } */
-/* { dg-bogus "redefined" "f redefined" { target *-*-* } 15 } */
-/* { dg-bogus "redefined" "baz redefined" { target *-*-* } 18 } */
-/* { dg-bogus "redefined" "g redefined" { target *-*-* } 22 } */
-
-/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 7 } */
-/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */
-/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 11 } */
-/* { dg-bogus "previous def" "f prev def" { target *-*-* } 14 } */
-/* { dg-bogus "previous def" "baz prev def" { target *-*-* } 17 } */
-/* { dg-bogus "previous def" "g prev def" { target *-*-* } 20 } */
+/* { dg-bogus "redefined" "g redefined" { target *-*-* } .-1 } */
+/* { dg-bogus "previous def" "g prev def" { target *-*-* } .-4 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/ucs.c b/gcc/testsuite/gcc.dg/cpp/ucs.c
index 3f3d97edfa5..4f76fa99bf5 100644
--- a/gcc/testsuite/gcc.dg/cpp/ucs.c
+++ b/gcc/testsuite/gcc.dg/cpp/ucs.c
@@ -54,7 +54,7 @@ void foo ()
c = L'\u000x'; /* { dg-error "incomplete" "non-hex digit in UCN" } */
/* If sizeof(HOST_WIDE_INT) > sizeof(wchar_t), we can get a multi-character
constant warning even for wide characters. */
- /* { dg-warning "too long|multi-character" "" { target *-*-* } 54 } */
+ /* { dg-warning "too long|multi-character" "" { target *-*-* } .-3 } */
c = '\u0024'; /* { dg-bogus "invalid" "0024 is a valid UCN" } */
c = "\u0040"[0]; /* { dg-bogus "invalid" "0040 is a valid UCN" } */
diff --git a/gcc/testsuite/gcc.dg/declspec-10.c b/gcc/testsuite/gcc.dg/declspec-10.c
index fa465664a05..241422bd5ee 100644
--- a/gcc/testsuite/gcc.dg/declspec-10.c
+++ b/gcc/testsuite/gcc.dg/declspec-10.c
@@ -16,7 +16,10 @@ void f6 (static int); /* { dg-error "storage class specified for unnamed paramet
void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */
auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */
-register int y; /* { dg-warning "file-scope declaration of 'y' specifies 'register'" } */
+
+register int y;
+/* { dg-warning "file-scope declaration of 'y' specifies 'register'" "" { target *-*-* } .-1 } */
+/* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } .-2 } */
void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */
/* { dg-warning "ISO C forbids nested functions" "nested" { target *-*-* } .-1 } */
@@ -43,5 +46,3 @@ void i (void) { auto void y (void) {} } /* { dg-warning "ISO C forbids nested fu
/* { dg-warning "function definition declared 'auto'" "nested" { target *-*-* } .-1 } */
inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */
-
-/* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } 19 } */
diff --git a/gcc/testsuite/gcc.dg/declspec-11.c b/gcc/testsuite/gcc.dg/declspec-11.c
index d9fafde77ba..58f35ab7c79 100644
--- a/gcc/testsuite/gcc.dg/declspec-11.c
+++ b/gcc/testsuite/gcc.dg/declspec-11.c
@@ -16,7 +16,10 @@ void f6 (static int); /* { dg-error "storage class specified for unnamed paramet
void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */
auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */
-register int y; /* { dg-error "file-scope declaration of 'y' specifies 'register'" } */
+
+register int y;
+/* { dg-error "file-scope declaration of 'y' specifies 'register'" "" { target *-*-* } .-1 } */
+/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } .-2 } */
void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */
/* { dg-error "ISO C forbids nested functions" "nested" { target *-*-* } .-1 } */
@@ -43,5 +46,3 @@ void i (void) { auto void y (void) {} } /* { dg-error "ISO C forbids nested func
/* { dg-error "function definition declared 'auto'" "nested" { target *-*-* } .-1 } */
inline int main (void) { return 0; } /* { dg-error "cannot inline function 'main'" } */
-
-/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */
diff --git a/gcc/testsuite/gcc.dg/declspec-18.c b/gcc/testsuite/gcc.dg/declspec-18.c
index 0a111787047..2885692e1f3 100644
--- a/gcc/testsuite/gcc.dg/declspec-18.c
+++ b/gcc/testsuite/gcc.dg/declspec-18.c
@@ -23,36 +23,48 @@ struct s {
};
typeof (z) c1;
-typeof (x1) c2; /* { dg-error "undeclared" "undeclared" } */
+
+typeof (x1) c2;
+/* { dg-error "undeclared" "undeclared" { target *-*-* } .-1 } */
+/* { dg-bogus "unknown type name 'x1'" "unknown" { target *-*-* } .-2 } */
+
typeof (const t11) c3; /* { dg-error "unknown type name 't11'" } */
-typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } } */
-/* { dg-bogus "unknown type name 'x1'" unknown"" { target *-*-* } 26 } */
-/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 28 } */
-/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 28 } */
+
+typeof (t12 *) c3;
+/* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } .-1 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } .-2 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } .-3 } */
int recover1;
int s0 = sizeof (z);
-int s1 = sizeof (x2); /* { dg-error "undeclared" "undeclared" } */
+
+int s1 = sizeof (x2);
+/* { dg-error "undeclared" "undeclared" { target *-*-* } .-1 } */
+/* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } .-2 } */
+
int s2 = sizeof (const t13); /* { dg-error "unknown type name 't13'" } */
-int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } } */
-int recover2;
+int s3 = sizeof (t14 *);
+/* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } .-1 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } .-2 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } .-3 } */
-/* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } 36 } */
-/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 38 } */
-/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 38 } */
+int recover2;
int a0 = __alignof__ (z);
+
int a1 = __alignof__ (x3); /* { dg-error "undeclared" } */
+/* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } .-1 } */
+
int a2 = __alignof__ (const t15); /* { dg-error "unknown type name 't15'" } */
-int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } } */
-int recover3;
+int a3 = __alignof__ (t16 *);
+/* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } .-1 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } .-2 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } .-3 } */
-/* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } 47 } */
-/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 49 } */
-/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 49 } */
+int recover3;
/* Cannot detect (undefd_type *) or (undefd_type (*) because it would
diff --git a/gcc/testsuite/gcc.dg/format/c99-strftime-1.c b/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
index 7530bbdc944..99a2fc68362 100644
--- a/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
+++ b/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
@@ -29,10 +29,10 @@ foo (char *s, size_t m, const struct tm *tp)
/* Bad uses of %E and %O. */
strftime (s, m, "%EEY", tp); /* { dg-warning "multiple|repeated" "multiple %E/%O" } */
strftime (s, m, "%EOy", tp); /* { dg-warning "multiple|together" "multiple %E/%O" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%OEy", tp); /* { dg-warning "multiple|together" "multiple %E/%O" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%OOV", tp); /* { dg-warning "multiple|repeated" "multiple %E/%O" } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 31 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 32 } */
strftime (s, m, "%Ea", tp); /* { dg-warning "flag|modifier" "bad %Ea" } */
strftime (s, m, "%EA", tp); /* { dg-warning "flag|modifier" "bad %EA" } */
strftime (s, m, "%Eb", tp); /* { dg-warning "flag|modifier" "bad %Eb" } */
diff --git a/gcc/testsuite/gcc.dg/format/ext-3.c b/gcc/testsuite/gcc.dg/format/ext-3.c
index 937e11212f7..a59edb45e50 100644
--- a/gcc/testsuite/gcc.dg/format/ext-3.c
+++ b/gcc/testsuite/gcc.dg/format/ext-3.c
@@ -85,31 +85,33 @@ foo (char *s, size_t m, const struct tm *tp)
strftime (s, m, "%-Z", tp); /* { dg-warning "flag" "bad %Z" } */
strftime (s, m, "%_Z", tp); /* { dg-warning "flag" "bad %Z" } */
strftime (s, m, "%0Z", tp); /* { dg-warning "flag" "bad %Z" } */
+
/* Incorrect usages with Y2K problems. */
strftime (s, m, "%5c", tp); /* { dg-warning "width" "bad %c" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%-c", tp); /* { dg-warning "flag" "bad %c" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%_c", tp); /* { dg-warning "flag" "bad %c" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%0c", tp); /* { dg-warning "flag" "bad %c" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%5D", tp); /* { dg-warning "width" "bad %D" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%-D", tp); /* { dg-warning "flag" "bad %D" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%_D", tp); /* { dg-warning "flag" "bad %D" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%0D", tp); /* { dg-warning "flag" "bad %D" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%5x", tp); /* { dg-warning "width" "bad %x" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%-x", tp); /* { dg-warning "flag" "bad %x" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%_x", tp); /* { dg-warning "flag" "bad %x" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%0x", tp); /* { dg-warning "flag" "bad %x" } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 89 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 90 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 91 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 92 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 93 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 94 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 95 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 96 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 97 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 98 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 99 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 100 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
+
/* Incorrect usages with GNU extension conversion characters. */
strftime (s, m, "%5P", tp); /* { dg-warning "width" "bad %P" } */
strftime (s, m, "%-P", tp); /* { dg-warning "flag" "bad %P" } */
@@ -178,27 +180,29 @@ foo (char *s, size_t m, const struct tm *tp)
strftime (s, m, "%#l", tp); /* { dg-warning "flag" "bad %l" } */
strftime (s, m, "%^s", tp); /* { dg-warning "flag" "bad %s" } */
strftime (s, m, "%#s", tp); /* { dg-warning "flag" "bad %s" } */
+
/* Bad usages with Y2K problems. */
strftime (s, m, "%^c", tp); /* { dg-warning "flag" "bad %c" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%#c", tp); /* { dg-warning "flag" "bad %c" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%^D", tp); /* { dg-warning "flag" "bad %D" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%#D", tp); /* { dg-warning "flag" "bad %D" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%^g", tp); /* { dg-warning "flag" "bad %g" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%#g", tp); /* { dg-warning "flag" "bad %g" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%^x", tp); /* { dg-warning "flag" "bad %x" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%#x", tp); /* { dg-warning "flag" "bad %x" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%^y", tp); /* { dg-warning "flag" "bad %y" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
strftime (s, m, "%#y", tp); /* { dg-warning "flag" "bad %y" } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 182 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 183 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 184 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 185 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 186 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 187 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 188 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 189 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 190 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 191 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */
+
/* GCC also accepts the glibc format extensions %P, %k, %l, %s. */
strftime (s, m, "%P%k%l%s", tp);
/* GCC also accepts the glibc extension of the "O" modifier on some
diff --git a/gcc/testsuite/gcc.dg/format/pr72858.c b/gcc/testsuite/gcc.dg/format/pr72858.c
index d8d0499b778..c142d243ddb 100644
--- a/gcc/testsuite/gcc.dg/format/pr72858.c
+++ b/gcc/testsuite/gcc.dg/format/pr72858.c
@@ -389,19 +389,21 @@ test_LE (char *d, int iexpr, float fexpr, double dexpr, long double ldexpr)
void
test_everything (char *d, long lexpr)
{
- sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr); /* { dg-warning "26: field width specifier '\\*' expects argument of type 'int', but argument 3 has type 'long int'" } */
+ sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr); /* { dg-line test_everything_sprintf } */
+
+ /* { dg-warning "26: field width specifier '\\*' expects argument of type 'int', but argument 3 has type 'long int'" "" { target *-*-* } test_everything_sprintf } */
/* { dg-begin-multiline-output "" }
sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr);
~~~^~~~~~
{ dg-end-multiline-output "" } */
- /* { dg-warning "28: field precision specifier '\\.\\*' expects argument of type 'int', but argument 4 has type 'long int'" "" { target *-*-* } 392 } */
+ /* { dg-warning "28: field precision specifier '\\.\\*' expects argument of type 'int', but argument 4 has type 'long int'" "" { target *-*-* } test_everything_sprintf } */
/* { dg-begin-multiline-output "" }
sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr);
~~~~~^~~~
{ dg-end-multiline-output "" } */
- /* { dg-warning "31: format '%lld' expects argument of type 'long long int', but argument 5 has type 'long int'" "" { target *-*-* } 392 } */
+ /* { dg-warning "31: format '%lld' expects argument of type 'long long int', but argument 5 has type 'long int'" "" { target *-*-* } test_everything_sprintf } */
/* { dg-begin-multiline-output "" }
sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr);
~~~~~~~~^
diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
index 1333b70582f..e0f0eca2fa5 100644
--- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
+++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
@@ -10,7 +10,7 @@ a24 (int a)
const int c = 1;
int i = 0;
int l = 0;
-#pragma omp parallel default(none) private(a) shared(z)
+#pragma omp parallel default(none) private(a) shared(z) /* { dg-line omp_parallel } */
{
int j = omp_get_num_threads ();
/* O.K. - j is declared within parallel region */
@@ -20,8 +20,8 @@ a24 (int a)
/* - c has const-qualified type */
z[i] = y;
/* { dg-error "'i' not specified" "" { target *-*-* } .-1 } */
- /* { dg-error "enclosing 'parallel'" "" { target *-*-* } 13 } */
- /* { dg-error "'y' not specified" "" { target *-*-* } 21 } */
+ /* { dg-error "enclosing 'parallel'" "" { target *-*-* } omp_parallel } */
+ /* { dg-error "'y' not specified" "" { target *-*-* } .-3 } */
#pragma omp for firstprivate(y)
for (i = 0; i < 10; i++)
{
diff --git a/gcc/testsuite/gcc.dg/init-string-1.c b/gcc/testsuite/gcc.dg/init-string-1.c
index 19bdf647066..67bd7961b75 100644
--- a/gcc/testsuite/gcc.dg/init-string-1.c
+++ b/gcc/testsuite/gcc.dg/init-string-1.c
@@ -29,8 +29,9 @@ struct s j = {
"j",
1,
(L"j")
+ /* { dg-error "parenthesized|near init" "paren array" { target *-*-* } .-1 } */
}; /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 31 } */
+
struct s k = {
(("k")), /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } .-1 } */
@@ -47,8 +48,8 @@ struct s l = {
struct s m = {
.c = L"m",
.a = ("m")
+ /* { dg-error "parenthesized|near init" "paren array" { target *-*-* } .-1 } */
}; /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 49 } */
char *n = (char []){ "n" };
diff --git a/gcc/testsuite/gcc.dg/label-decl-3.c b/gcc/testsuite/gcc.dg/label-decl-3.c
index 32daea87f18..2e9ea09e1fd 100644
--- a/gcc/testsuite/gcc.dg/label-decl-3.c
+++ b/gcc/testsuite/gcc.dg/label-decl-3.c
@@ -10,8 +10,8 @@ void
f (void)
{
__label__ a, b, c, d;
+ /* { dg-error "ISO C forbids label declarations" "label decls" { target *-*-* } .-1 } */
__extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */
- /* { dg-error "ISO C forbids label declarations" "label decls" { target *-*-* } 12 } */
goto c; /* { dg-error "label 'c' used but not defined" } */
a: (void)0;
b: (void)0;
diff --git a/gcc/testsuite/gcc.dg/m-un-2.c b/gcc/testsuite/gcc.dg/m-un-2.c
index b12c7cb5ec9..141b81bb0f1 100644
--- a/gcc/testsuite/gcc.dg/m-un-2.c
+++ b/gcc/testsuite/gcc.dg/m-un-2.c
@@ -9,14 +9,14 @@ extern void* realloc (void*, size_t);
struct vtable {
void* (* _malloc) (size_t);
void (* _free) (void*);
- void* (* _realloc) (void*, size_t);
+ void* (* _realloc) (void*, size_t); /* { dg-line vtable_realloc } */
};
struct vtable mtable = {
malloc,
free
}; /* { dg-warning "missing initializer" "warning regression" } */
- /* { dg-message "declared here" "warning regression 2" { target *-*-* } 12 } */
+ /* { dg-message "declared here" "warning regression 2" { target *-*-* } vtable_realloc } */
/* With designated initializers, we assume you meant to leave out the
initialization of any blank fields. */
diff --git a/gcc/testsuite/gcc.dg/nofixed-point-2.c b/gcc/testsuite/gcc.dg/nofixed-point-2.c
index 8442a1984cf..166a6bcb9e6 100644
--- a/gcc/testsuite/gcc.dg/nofixed-point-2.c
+++ b/gcc/testsuite/gcc.dg/nofixed-point-2.c
@@ -20,10 +20,10 @@ f3 (void)
return 0k; /* { dg-error "not supported" "reject fixed-point" } */
}
-_Sat /* { dg-error "not supported" "reject fixed-point" } */
+_Sat
+/* { dg-error "not supported" "reject fixed-point" { target *-*-* } .-1 } */
+/* { dg-error "is used without" "" { target *-*-* } .-2 } */
f4 (void)
{
return 0k; /* { dg-error "not supported" "reject fixed-point" } */
}
-
-/* { dg-error "is used without" "" { target *-*-* } 23 } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/20020213-1.c b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
index 41480f0794d..fa86e4789ff 100644
--- a/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
@@ -2,9 +2,15 @@
Test whether argument checking is done for fputs, bzero and bcmp. */
typedef struct { int i; } FILE;
typedef __SIZE_TYPE__ size_t;
+
int fputs (const char *, FILE *);
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
+
void bzero (void *, size_t);
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
+
int bcmp (const void *, const void *, size_t);
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
char buf[32];
FILE *f;
@@ -12,23 +18,26 @@ FILE *f;
int main ()
{
fputs ("foo"); /* { dg-error "too few" } */
+
fputs ("foo", "bar", "baz"); /* { dg-error "too many" } */
+ /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-1 } */
+
fputs (21, 43);
+ /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
+ /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-2 } */
+
bzero (buf); /* { dg-error "too few" } */
+
bzero (21); /* { dg-error "too few" } */
+ /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
+
bcmp (buf, buf + 16); /* { dg-error "too few" } */
+
bcmp (21); /* { dg-error "too few" } */
+ /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
+
fputs ("foo", f);
bzero (buf, 32);
bcmp (buf, buf + 16, 16);
return 0;
}
-
-/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 15 } */
-/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */
-/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 16 } */
-/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 16 } */
-/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 18 } */
-/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 6 } */
-/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 20 } */
-/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 7 } */
diff --git a/gcc/testsuite/gcc.dg/pch/counter-2.c b/gcc/testsuite/gcc.dg/pch/counter-2.c
index 14ce24909c8..c0d25bf3fcc 100644
--- a/gcc/testsuite/gcc.dg/pch/counter-2.c
+++ b/gcc/testsuite/gcc.dg/pch/counter-2.c
@@ -9,7 +9,7 @@
#include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */
/* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 0 } */
-/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */
+/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } .-2 } */
/* { dg-message "terminated" "" { target *-*-* } 0 } */
int main(void)
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c
index e916b93bb5d..e9d98f4d6be 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c
@@ -30,7 +30,7 @@ test_stringized_token_2 (int x)
} while (0)
EXAMPLE(x > 0, 1, 1, 6);
- /* { dg-error "unable to read substring location: cpp_interpret_string_1 failed" "" { target *-*-* } 28 } */
+ /* { dg-error "unable to read substring location: cpp_interpret_string_1 failed" "" { target *-*-* } .-5 } */
#undef EXAMPLE
}
diff --git a/gcc/testsuite/gcc.dg/pr27528.c b/gcc/testsuite/gcc.dg/pr27528.c
index 4f33a31cb57..c9bb238e96b 100644
--- a/gcc/testsuite/gcc.dg/pr27528.c
+++ b/gcc/testsuite/gcc.dg/pr27528.c
@@ -1,18 +1,23 @@
/* Check the warnings and errors generated for asm operands that aren't
obviously constant but that are constrained to be constants. */
/* { dg-options "" } */
-/* { dg-error "impossible constraint" "" { target *-*-* } 13 } */
-/* { dg-error "impossible constraint" "" { target *-*-* } 14 } */
-/* { dg-error "impossible constraint" "" { target *-*-* } 15 } */
-/* { dg-error "impossible constraint" "" { target *-*-* } 16 } */
+
int bar (int);
void
foo (int *x, int y)
{
int constant = 0;
asm ("# %0" :: "i" (x)); /* { dg-warning "probably doesn't match" } */
+ /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */
+
asm ("# %0" :: "i" (bar (*x))); /* { dg-warning "probably doesn't match" } */
+ /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */
+
asm ("# %0" :: "i" (*x + 0x11)); /* { dg-warning "probably doesn't match" } */
+ /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */
+
asm ("# %0" :: "i" (constant)); /* { dg-warning "probably doesn't match" } */
+ /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */
+
asm ("# %0" :: "i" (y * 0)); /* folded */
}
diff --git a/gcc/testsuite/gcc.dg/pr27953.c b/gcc/testsuite/gcc.dg/pr27953.c
index 74fd5ddbe37..99ae0a3aa83 100644
--- a/gcc/testsuite/gcc.dg/pr27953.c
+++ b/gcc/testsuite/gcc.dg/pr27953.c
@@ -1,7 +1,9 @@
/* PR c/27953 */
-void foo(struct A a) {} /* { dg-warning "declared inside parameter list" "inside" } */
-/* { dg-error "incomplete type" "incomplete" { target *-*-* } .-1 } */
+void foo(struct A a) {} /* { dg-line foo_first } */
+/* { dg-warning "declared inside parameter list" "inside" { target *-*-* } .-1 } */
+/* { dg-error "incomplete type" "incomplete" { target *-*-* } .-2 } */
-void foo() {} /* { dg-error "redefinition" "redef" } */
-/* { dg-message "note: previous definition" "previous" { target *-*-* } 3 } */
+void foo() {}
+/* { dg-error "redefinition" "redef" { target *-*-* } .-1 } */
+/* { dg-message "note: previous definition" "previous" { target *-*-* } foo_first } */
diff --git a/gcc/testsuite/gcc.dg/pr35899.c b/gcc/testsuite/gcc.dg/pr35899.c
index 7bfb53f5477..5361582d5dc 100644
--- a/gcc/testsuite/gcc.dg/pr35899.c
+++ b/gcc/testsuite/gcc.dg/pr35899.c
@@ -5,13 +5,14 @@
int
foo (void)
{
- int a = bar ();
+ int a = bar (); /* { dg-line bar_implicit_decl } */
return a;
}
void
-bar (void) /* { dg-warning "conflicting types for" } */
+bar (void)
+/* { dg-warning "conflicting types for" "" { target *-*-* } .-1 } */
+/* { dg-message "note: previous implicit declaration" "" { target *-*-* } bar_implicit_decl } */
{
}
-/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 8 } */
diff --git a/gcc/testsuite/gcc.dg/pr37561.c b/gcc/testsuite/gcc.dg/pr37561.c
index 3ad826329f9..e73beccfea4 100644
--- a/gcc/testsuite/gcc.dg/pr37561.c
+++ b/gcc/testsuite/gcc.dg/pr37561.c
@@ -8,16 +8,23 @@ void
foo ()
{
((char *) p)++; /* { dg-error "lvalue" } */
+
((char *) q)++; /* { dg-error "lvalue" } */
+ /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
+
((char *) p)--; /* { dg-error "lvalue" } */
+
((char *) q)--; /* { dg-error "lvalue" } */
+ /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
+
++(char *) p; /* { dg-error "lvalue" } */
+
++(char *) q; /* { dg-error "lvalue" } */
+ /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
+
--(char *) p; /* { dg-error "lvalue" } */
+
--(char *) q; /* { dg-error "lvalue" } */
+ /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
}
-/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 11 } */
-/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 13 } */
-/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 15 } */
-/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 17 } */
diff --git a/gcc/testsuite/gcc.dg/pr45461.c b/gcc/testsuite/gcc.dg/pr45461.c
index 7f287bd0305..db86d86ae58 100644
--- a/gcc/testsuite/gcc.dg/pr45461.c
+++ b/gcc/testsuite/gcc.dg/pr45461.c
@@ -9,10 +9,12 @@ foo (int i, ...)
short e;
va_list ap;
va_start (ap, i);
+
e = va_arg (ap, short); /* { dg-warning "is promoted" "promoted" } */
+ /* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } .-1 } */
+ /* { dg-message "note: if this code" "if this code" {target *-*-* } .-2 } */
+
va_end (ap);
return e;
}
-/* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } 12 } */
-/* { dg-message "note: if this code" "if this code" {target *-*-* } 12 } */
diff --git a/gcc/testsuite/gcc.dg/pr45750.c b/gcc/testsuite/gcc.dg/pr45750.c
index 22c471b7070..0359c61c6f5 100644
--- a/gcc/testsuite/gcc.dg/pr45750.c
+++ b/gcc/testsuite/gcc.dg/pr45750.c
@@ -11,6 +11,6 @@ int invalid[] = 0; /* { dg-error "invalid initializer" } */
void foo (void)
{
if (((struct S *)undeclared)->i); /* { dg-error "undeclared" } */
+ /* { dg-message "reported only once" "" { target *-*-* } .-1 } */
}
-/* { dg-message "reported only once" "" { target *-*-* } 13 } */
diff --git a/gcc/testsuite/gcc.dg/pr53196-2.c b/gcc/testsuite/gcc.dg/pr53196-2.c
index efb6a82c6bb..1d47b86e4b4 100644
--- a/gcc/testsuite/gcc.dg/pr53196-2.c
+++ b/gcc/testsuite/gcc.dg/pr53196-2.c
@@ -8,9 +8,11 @@ struct foo { int i; };
int
main ()
{
- struct foo f = (struct foo_typo) { }; /* { dg-error "invalid use of undefined type" } */
+ struct foo f = (struct foo_typo) { };
+ /* { dg-error "invalid use of undefined type" "" { target *-*-* } .-1 } */
+ /* { dg-error "ISO C forbids empty initializer braces" "" { target *-*-* } .-2 } */
+
printf ("%d\n", f.i);
return 0;
}
-/* { dg-error "ISO C forbids empty initializer braces" "" { target *-*-* } 11 } */
diff --git a/gcc/testsuite/gcc.dg/pr53265.c b/gcc/testsuite/gcc.dg/pr53265.c
index ea39d69f8e1..d6418228c3b 100644
--- a/gcc/testsuite/gcc.dg/pr53265.c
+++ b/gcc/testsuite/gcc.dg/pr53265.c
@@ -86,11 +86,12 @@ fn7 (void)
{
int a[16], b, c;
bar (a);
- for (b = a[c = 0]; c < 16; b = a[++c]) /* { dg-warning "15 invokes undefined behavior" } */
+ for (b = a[c = 0]; c < 16; b = a[++c])
+ /* { dg-warning "15 invokes undefined behavior" "" { target *-*-* } .-1 } */
+ /* { dg-message "note: within this loop" "" { target *-*-* } .-2 } */
baz (b);
}
-/* { dg-message "note: within this loop" "" { target *-*-* } 89 } */
const void *va, *vb, *vc, *vd, *ve;
const void *vf[4];
diff --git a/gcc/testsuite/gcc.dg/redecl-1.c b/gcc/testsuite/gcc.dg/redecl-1.c
index 1fb0070dd55..a7ae0bd504f 100644
--- a/gcc/testsuite/gcc.dg/redecl-1.c
+++ b/gcc/testsuite/gcc.dg/redecl-1.c
@@ -52,13 +52,14 @@ void test3(void)
void prime4(void)
{
- bar4(); /* { dg-warning "implicit declaration of function" "implicit" } */
+ bar4(); /* { dg-line implicit_bar4 } */
+ /* { dg-warning "implicit declaration of function" "implicit" { target *-*-* } implicit_bar4 } */
}
void test4(void)
{
extern double bar4(double); /* { dg-error "conflict" } */
-/* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } 55 } */
+/* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } implicit_bar4 } */
}
/* Implicit decl, clashing with extern at previous function scope. */
diff --git a/gcc/testsuite/gcc.dg/tls/thr-init-1.c b/gcc/testsuite/gcc.dg/tls/thr-init-1.c
index eb2f84695fb..a9b60612be2 100644
--- a/gcc/testsuite/gcc.dg/tls/thr-init-1.c
+++ b/gcc/testsuite/gcc.dg/tls/thr-init-1.c
@@ -2,7 +2,8 @@
/* { dg-require-effective-target tls } */
static __thread int fstat ;
-static __thread int fstat = 1 ;
+static __thread int fstat = 1 ; /* { dg-line fstat_prev } */
static __thread int fstat ;
-static __thread int fstat = 2; /* { dg-error "redefinition of 'fstat'" } */
- /* { dg-message "note: previous definition of 'fstat' was here" "" { target *-*-* } 5 } */
+static __thread int fstat = 2;
+/* { dg-error "redefinition of 'fstat'" "" { target *-*-* } .-1 } */
+/* { dg-message "note: previous definition of 'fstat' was here" "" { target *-*-* } fstat_prev } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-1.c b/gcc/testsuite/gcc.dg/torture/pr51106-1.c
index 10b3b682b98..8a1227d30d6 100644
--- a/gcc/testsuite/gcc.dg/torture/pr51106-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr51106-1.c
@@ -6,9 +6,9 @@ int
foo (int x)
{
asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */
+ /* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } .-1 } */
return 1;
lab:
return 0;
}
-/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 8 } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-2.c b/gcc/testsuite/gcc.dg/torture/pr51106-2.c
index bab0987fff7..42095536c60 100644
--- a/gcc/testsuite/gcc.dg/torture/pr51106-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr51106-2.c
@@ -7,9 +7,9 @@ int
bar (int x)
{
asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */
+/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } .-1 } */
__builtin_unreachable ();
lab:
return 0;
}
-/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 9 } */
diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c
index aa1b3fb6fe0..094dc0eb73d 100644
--- a/gcc/testsuite/gcc.dg/uninit-19.c
+++ b/gcc/testsuite/gcc.dg/uninit-19.c
@@ -11,7 +11,8 @@ fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,
unsigned char *c2, float *p10)
{
if (p1 & 8)
- b[3] = p10[a]; /* 14. */
+ b[3] = p10[a];
+ /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } .-1 } */
}
void
@@ -20,8 +21,6 @@ fn2 ()
float *n;
if (l & 6)
n = &c + m;
- fn1 (l, &d, &e, &g, &i, &h, &k, n); /* 23. */
+ fn1 (l, &d, &e, &g, &i, &h, &k, n);
+ /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } .-1 } */
}
-
-/* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } 14 } */
-/* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } 23 } */
diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644.c b/gcc/testsuite/gcc.dg/uninit-pr20644.c
index e13910becd1..a9a73241ef5 100644
--- a/gcc/testsuite/gcc.dg/uninit-pr20644.c
+++ b/gcc/testsuite/gcc.dg/uninit-pr20644.c
@@ -16,9 +16,10 @@ int bar ()
{
int i = 1;
int j;
+ /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } .-1 } */
if (1 == i)
- return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 18 } */
+ return j;
return 0;
}