Replace absolute line numbers in c-c++-common
2017-05-03 Tom de Vries <tom@codesourcery.com> 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
This commit is contained in:
parent
962913a561
commit
53e62089fb
14 changed files with 52 additions and 40 deletions
|
@ -1,3 +1,20 @@
|
|||
2017-05-03 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
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 <tom@codesourcery.com>
|
||||
|
||||
* c-c++-common/goacc/data-default-1.c: Add quotes to numerical comment
|
||||
|
|
|
@ -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 } */
|
||||
|
|
|
@ -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 } */
|
||||
|
|
|
@ -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 } */
|
||||
|
|
|
@ -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 } */
|
||||
|
|
|
@ -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 } */
|
||||
|
||||
|
|
|
@ -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 } */
|
||||
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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 } */
|
||||
|
|
|
@ -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 } */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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 } */
|
||||
|
|
|
@ -18,12 +18,12 @@ void
|
|||
foo (void)
|
||||
{
|
||||
memcpy (0, 0, 0);
|
||||
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 2" "" { target *-*-* } .-2 } */
|
||||
|
||||
/* { 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 } */
|
||||
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 } */
|
||||
}
|
||||
|
|
|
@ -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 } */
|
||||
}
|
||||
|
|
|
@ -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 } */
|
||||
|
|
Loading…
Add table
Reference in a new issue