+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
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
r += -1U >> x;
return r;
}
-
-/* { dg-error "left operand of shift expression" "shift" { target c++ } 9 } */
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
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 } */
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
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 } */
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
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 } */
/* 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];
}
-/* { dg-message "note: each" "defined" { target c } 11 } */
/* { 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 } */
+
(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. */
#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)
#pragma acc enter data2 /* { dg-error "expected 'data' after" } */
}
-/* { dg-error "has no data movement clause" "" { target *-*-* } 8 } */
;
#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 } */
}
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" } */
;
}
-/* { dg-error "linear clause applied to" "" { target *-*-* } 12 } */
-/* { dg-error "(incomplete|undefined) type" "" { target *-*-* } 12 } */
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 } */
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 } */
}
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 } */