From: Tom de Vries Date: Wed, 3 May 2017 07:33:01 +0000 (+0000) Subject: Replace absolute line numbers in c-c++-common X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53e62089fbe61bbf59dd1b14d006a619de7b5f87;p=gcc.git Replace absolute line numbers in c-c++-common 2017-05-03 Tom de Vries PR testsuite/80557 * c-c++-common/Wshift-negative-value-1.c: Replace absolute line numbers. * c-c++-common/Wshift-negative-value-2.c: Same. * c-c++-common/Wshift-negative-value-3.c: Same. * c-c++-common/Wshift-negative-value-4.c: Same. * c-c++-common/cilk-plus/AN/pr57541.c: Same. * c-c++-common/cpp/pr60400.c: Same. * c-c++-common/fmax-errors.c: Same. * c-c++-common/goacc/data-2.c: Same. * c-c++-common/goacc/host_data-2.c: Same. * c-c++-common/gomp/simd4.c: Same. * c-c++-common/pr28656.c: Same. * c-c++-common/pr43395.c: Same. * c-c++-common/torture/pr57945.c: Same. From-SVN: r247537 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8cfebd41456..e84e04540c2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,20 @@ +2017-05-03 Tom de Vries + + PR testsuite/80557 + * c-c++-common/Wshift-negative-value-1.c: Replace absolute line numbers. + * c-c++-common/Wshift-negative-value-2.c: Same. + * c-c++-common/Wshift-negative-value-3.c: Same. + * c-c++-common/Wshift-negative-value-4.c: Same. + * c-c++-common/cilk-plus/AN/pr57541.c: Same. + * c-c++-common/cpp/pr60400.c: Same. + * c-c++-common/fmax-errors.c: Same. + * c-c++-common/goacc/data-2.c: Same. + * c-c++-common/goacc/host_data-2.c: Same. + * c-c++-common/gomp/simd4.c: Same. + * c-c++-common/pr28656.c: Same. + * c-c++-common/pr43395.c: Same. + * c-c++-common/torture/pr57945.c: Same. + 2017-05-03 Tom de Vries * c-c++-common/goacc/data-default-1.c: Add quotes to numerical comment diff --git a/gcc/testsuite/c-c++-common/Wshift-negative-value-1.c b/gcc/testsuite/c-c++-common/Wshift-negative-value-1.c index 8f140345608..7df1804615d 100644 --- a/gcc/testsuite/c-c++-common/Wshift-negative-value-1.c +++ b/gcc/testsuite/c-c++-common/Wshift-negative-value-1.c @@ -7,6 +7,7 @@ enum E { A = 0 << 1, B = 1 << 1, C = -1 << 1, /* { dg-warning "left shift of negative value|not an integer constant" } */ + /* { dg-error "left operand of shift expression" "shift" { target c++ } .-1 } */ D = 0 >> 1, E = 1 >> 1, F = -1 >> 1 @@ -47,5 +48,3 @@ right (int x) r += -1U >> x; return r; } - -/* { dg-error "left operand of shift expression" "shift" { target c++ } 9 } */ diff --git a/gcc/testsuite/c-c++-common/Wshift-negative-value-2.c b/gcc/testsuite/c-c++-common/Wshift-negative-value-2.c index 55523a531f5..3a60ed7e1b8 100644 --- a/gcc/testsuite/c-c++-common/Wshift-negative-value-2.c +++ b/gcc/testsuite/c-c++-common/Wshift-negative-value-2.c @@ -7,6 +7,8 @@ enum E { A = 0 << 1, B = 1 << 1, C = -1 << 1, /* { dg-warning "left shift of negative value" } */ + /* { dg-error "not an integer constant" "no constant" { target c++ } .-1 } */ + /* { dg-error "left operand of shift expression" "shift" { target c++ } .-2 } */ D = 0 >> 1, E = 1 >> 1, F = -1 >> 1 @@ -47,6 +49,3 @@ right (int x) r += -1U >> x; return r; } - -/* { dg-error "not an integer constant" "no constant" { target c++ } 9 } */ -/* { dg-error "left operand of shift expression" "shift" { target c++ } 9 } */ diff --git a/gcc/testsuite/c-c++-common/Wshift-negative-value-3.c b/gcc/testsuite/c-c++-common/Wshift-negative-value-3.c index 1295b725569..503ca61eb61 100644 --- a/gcc/testsuite/c-c++-common/Wshift-negative-value-3.c +++ b/gcc/testsuite/c-c++-common/Wshift-negative-value-3.c @@ -7,6 +7,8 @@ enum E { A = 0 << 1, B = 1 << 1, C = -1 << 1, + /* { dg-error "not an integer constant" "no constant" { target c++ } .-1 } */ + /* { dg-error "left operand of shift expression" "shift" { target c++ } .-2 } */ D = 0 >> 1, E = 1 >> 1, F = -1 >> 1 @@ -47,6 +49,3 @@ right (int x) r += -1U >> x; return r; } - -/* { dg-error "not an integer constant" "no constant" { target c++ } 9 } */ -/* { dg-error "left operand of shift expression" "shift" { target c++ } 9 } */ diff --git a/gcc/testsuite/c-c++-common/Wshift-negative-value-4.c b/gcc/testsuite/c-c++-common/Wshift-negative-value-4.c index 3088220ffa7..fa7cb4e7f51 100644 --- a/gcc/testsuite/c-c++-common/Wshift-negative-value-4.c +++ b/gcc/testsuite/c-c++-common/Wshift-negative-value-4.c @@ -7,6 +7,8 @@ enum E { A = 0 << 1, B = 1 << 1, C = -1 << 1, + /* { dg-error "not an integer constant" "no constant" { target c++ } .-1 } */ + /* { dg-error "left operand of shift expression" "shift" { target c++ } .-2 } */ D = 0 >> 1, E = 1 >> 1, F = -1 >> 1 @@ -47,6 +49,3 @@ right (int x) r += -1U >> x; return r; } - -/* { dg-error "not an integer constant" "no constant" { target c++ } 9 } */ -/* { dg-error "left operand of shift expression" "shift" { target c++ } 9 } */ diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c index f379e461c5a..a956d0e18ab 100755 --- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c +++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c @@ -9,6 +9,7 @@ int foo () { /* C compiler uses the term "undeclared" whereas C++ compiler uses "not declared". Thus, grepping for declared seem to be the easiest. */ char c = (char)N; /* { dg-error "declared" } */ + /* { dg-message "note: each" "defined" { target c } .-1 } */ short s = (short)N; long l = (long)N; A[l:s:c]; @@ -22,5 +23,4 @@ int foo1 (int N) { } -/* { dg-message "note: each" "defined" { target c } 11 } */ diff --git a/gcc/testsuite/c-c++-common/cpp/pr60400.c b/gcc/testsuite/c-c++-common/cpp/pr60400.c index fc3e0d9f493..59e8aec36ef 100644 --- a/gcc/testsuite/c-c++-common/cpp/pr60400.c +++ b/gcc/testsuite/c-c++-common/cpp/pr60400.c @@ -2,12 +2,12 @@ /* { dg-do compile } */ /* { dg-options "-trigraphs -Wtrigraphs" } */ -??=include "pr60400-1.h" -??=include "pr60400-2.h" +??=include "pr60400-1.h" /* { dg-warning "trigraph" } */ +??=include "pr60400-2.h" /* { dg-warning "trigraph" } */ +/* These are line numbers in pr60400-{1,2}.h Keep them absolute. */ /* { dg-warning "trigraph" "" { target *-*-* } 1 } */ /* { dg-warning "trigraph" "" { target *-*-* } 2 } */ /* { dg-warning "trigraph" "" { target *-*-* } 3 } */ /* { dg-warning "trigraph" "" { target *-*-* } 4 } */ -/* { dg-warning "trigraph" "" { target *-*-* } 5 } */ -/* { dg-warning "trigraph" "" { target *-*-* } 6 } */ + diff --git a/gcc/testsuite/c-c++-common/fmax-errors.c b/gcc/testsuite/c-c++-common/fmax-errors.c index b44e2386ae5..947d60048a1 100644 --- a/gcc/testsuite/c-c++-common/fmax-errors.c +++ b/gcc/testsuite/c-c++-common/fmax-errors.c @@ -11,7 +11,7 @@ void foo (unsigned int i, unsigned int j) (k) (); /* { dg-error "" } */ /* Make sure we see the notes related to the final error we emit. */ - /* { dg-message "identifier" "" { target c } 12 } */ + /* { dg-message "identifier" "" { target c } .-2 } */ /* Warnings after the final error should not appear. */ i + j; /* no warning. */ diff --git a/gcc/testsuite/c-c++-common/goacc/data-2.c b/gcc/testsuite/c-c++-common/goacc/data-2.c index 1043bf8a072..a8723b04c8f 100644 --- a/gcc/testsuite/c-c++-common/goacc/data-2.c +++ b/gcc/testsuite/c-c++-common/goacc/data-2.c @@ -6,6 +6,7 @@ foo (void) #pragma acc enter data copyin (a, b) async wait #pragma acc enter data create (b[20:30]) async wait #pragma acc enter data (a) /* { dg-error "expected '#pragma acc' clause before '\\\(' token" } */ +/* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ #pragma acc enter data create (b(1:10)) /* { dg-error "expected '\\\)' before '\\\(' token" } */ #pragma acc exit data delete (a) if (0) #pragma acc exit data copyout (b) if (a) @@ -20,4 +21,3 @@ foo (void) #pragma acc enter data2 /* { dg-error "expected 'data' after" } */ } -/* { dg-error "has no data movement clause" "" { target *-*-* } 8 } */ diff --git a/gcc/testsuite/c-c++-common/goacc/host_data-2.c b/gcc/testsuite/c-c++-common/goacc/host_data-2.c index 6337465d06c..b3093e575ff 100644 --- a/gcc/testsuite/c-c++-common/goacc/host_data-2.c +++ b/gcc/testsuite/c-c++-common/goacc/host_data-2.c @@ -12,14 +12,14 @@ f (void) ; #pragma acc host_data use_device(v2) + /* { dg-error ".use_device_ptr. variable is neither a pointer nor an array" "" { target c } .-1 } */ + /* { dg-error ".use_device_ptr. variable is neither a pointer, nor an array nor reference to pointer or array" "" { target c++ } .-2 } */ ; - /* { dg-error ".use_device_ptr. variable is neither a pointer nor an array" "" { target c } 14 } */ - /* { dg-error ".use_device_ptr. variable is neither a pointer, nor an array nor reference to pointer or array" "" { target c++ } 14 } */ #pragma acc host_data use_device(v0) + /* { dg-error ".use_device_ptr. variable is neither a pointer nor an array" "" { target c } .-1 } */ + /* { dg-error ".use_device_ptr. variable is neither a pointer, nor an array nor reference to pointer or array" "" { target c++ } .-2 } */ ; - /* { dg-error ".use_device_ptr. variable is neither a pointer nor an array" "" { target c } 19 } */ - /* { dg-error ".use_device_ptr. variable is neither a pointer, nor an array nor reference to pointer or array" "" { target c++ } 19 } */ } diff --git a/gcc/testsuite/c-c++-common/gomp/simd4.c b/gcc/testsuite/c-c++-common/gomp/simd4.c index 399003388ae..8c4a031935a 100644 --- a/gcc/testsuite/c-c++-common/gomp/simd4.c +++ b/gcc/testsuite/c-c++-common/gomp/simd4.c @@ -10,6 +10,8 @@ void foo (void) { #pragma omp simd linear(p) linear(f : 1) + /* { dg-error "linear clause applied to" "" { target *-*-* } .-1 } */ + /* { dg-error "(incomplete|undefined) type" "" { target *-*-* } .-2 } */ for (int i = 0; i < 10; i++) ; #pragma omp simd linear(j : 7.0) /* { dg-error "step expression must be integral" } */ @@ -17,5 +19,3 @@ foo (void) ; } -/* { dg-error "linear clause applied to" "" { target *-*-* } 12 } */ -/* { dg-error "(incomplete|undefined) type" "" { target *-*-* } 12 } */ diff --git a/gcc/testsuite/c-c++-common/pr28656.c b/gcc/testsuite/c-c++-common/pr28656.c index a0c2339f593..903d7e51f1d 100644 --- a/gcc/testsuite/c-c++-common/pr28656.c +++ b/gcc/testsuite/c-c++-common/pr28656.c @@ -18,12 +18,12 @@ void foo (void) { memcpy (0, 0, 0); + /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } .-1 } */ + /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 2" "" { target *-*-* } .-2 } */ + bar (0, 0, 0, 0, 0); + /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } .-1 } */ + /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 3" "" { target *-*-* } .-2 } */ + /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 4" "" { target *-*-* } .-3 } */ + /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 5" "" { target *-*-* } .-4 } */ } - -/* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } 20 } */ -/* { dg-warning "null argument where non-null required\[^\n\r\]*argument 2" "" { target *-*-* } 20 } */ -/* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } 21 } */ -/* { dg-warning "null argument where non-null required\[^\n\r\]*argument 3" "" { target *-*-* } 21 } */ -/* { dg-warning "null argument where non-null required\[^\n\r\]*argument 4" "" { target *-*-* } 21 } */ -/* { dg-warning "null argument where non-null required\[^\n\r\]*argument 5" "" { target *-*-* } 21 } */ diff --git a/gcc/testsuite/c-c++-common/pr43395.c b/gcc/testsuite/c-c++-common/pr43395.c index 2c30634f45f..f672c8c1994 100644 --- a/gcc/testsuite/c-c++-common/pr43395.c +++ b/gcc/testsuite/c-c++-common/pr43395.c @@ -4,27 +4,27 @@ void * foo (void) { -lab: + lab: /* { dg-line foo_lab } */ return &&lab; /* { dg-warning "function returns address of label" "" { target c } .-1 } */ -/* { dg-warning "address of label" "" { target c++ } 7 } */ +/* { dg-warning "address of label" "" { target c++ } foo_lab } */ } void * bar (void) { __label__ lab; -lab: + lab: /* { dg-line bar_lab } */ return &&lab; /* { dg-warning "function returns address of label" "" { target c } .-1 } */ -/* { dg-warning "address of label" "" { target c++ } 17 } */ +/* { dg-warning "address of label" "" { target c++ } bar_lab } */ } void * baz (void) { - int i; + int i; /* { dg-line baz_i } */ return &i; /* { dg-warning "function returns address of local variable" "" { target c } .-1 } */ -/* { dg-warning "address of local variable" "" { target c++ } 26 } */ +/* { dg-warning "address of local variable" "" { target c++ } baz_i } */ } diff --git a/gcc/testsuite/c-c++-common/torture/pr57945.c b/gcc/testsuite/c-c++-common/torture/pr57945.c index 5a5977f31df..2678779d1dc 100644 --- a/gcc/testsuite/c-c++-common/torture/pr57945.c +++ b/gcc/testsuite/c-c++-common/torture/pr57945.c @@ -3,11 +3,10 @@ extern int j; static int i __attribute__((weakref("j"))); +/* { dg-error "PTX does not support weak declarations" "" { target nvptx-*-* } .-1 } */ int foo (void) { return &i ? i : 0; } - -/* { dg-error "PTX does not support weak declarations" "" { target nvptx-*-* } 5 } */