aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/overflow-warn-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/overflow-warn-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/overflow-warn-3.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-3.c b/gcc/testsuite/gcc.dg/overflow-warn-3.c
index fae26d4101d..664011e401d 100644
--- a/gcc/testsuite/gcc.dg/overflow-warn-3.c
+++ b/gcc/testsuite/gcc.dg/overflow-warn-3.c
@@ -13,16 +13,16 @@ enum e {
in the standard). */
E2 = 2 || 1 / 0,
E3 = 1 / 0, /* { dg-warning "division by zero" } */
- /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */
+ /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } .-1 } */
/* But as in DR#031, the 1/0 in an evaluated subexpression means the
whole expression violates the constraints. */
E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */
- /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } 19 } */
+ /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } .-1 } */
E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */
- /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 21 } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } .-1 } */
/* Again, overflow in evaluated subexpression. */
E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */
- /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 24 } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } .-1 } */
/* A cast does not constitute overflow in conversion. */
E7 = (char) INT_MAX
};
@@ -30,9 +30,9 @@ enum e {
struct s {
int a;
int : 0 * (1 / 0); /* { dg-warning "division by zero" } */
- /* { dg-error "not an integer constant" "integer constant" { target *-*-* } 32 } */
+ /* { dg-error "not an integer constant" "integer constant" { target *-*-* } .-1 } */
int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
- /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 34 } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } .-1 } */
};
void
@@ -46,17 +46,17 @@ f (void)
/* But this expression does need to be constant. */
static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
-/* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 48 } */
+/* { dg-warning "overflow in constant expression" "constant" { target *-*-* } .-1 } */
/* The first two of these involve overflow, so are not null pointer
constants. The third has the overflow in an unevaluated
subexpression, so is a null pointer constant. */
void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
-/* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 54 } */
-/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 54 } */
+/* { dg-warning "overflow in constant expression" "constant" { target *-*-* } .-1 } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } .-2 } */
void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */
-/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 57 } */
-/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 57 } */
+/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } .-1 } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } .-2 } */
void *r = (1 ? 0 : INT_MAX+1);
void
@@ -65,10 +65,10 @@ g (int i)
switch (i)
{
case 0 * (1/0): /* { dg-warning "division by zero" } */
- /* { dg-error "case label does not reduce to an integer constant" "constant" { target *-*-* } 67 } */
+ /* { dg-error "case label does not reduce to an integer constant" "constant" { target *-*-* } .-1 } */
;
case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */
- /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 70 } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } .-1 } */
;
}
}
@@ -91,15 +91,15 @@ void fsc (signed char);
void
h2 (void)
{
- fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
- fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
- fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */
- fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+ fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+ fsc (UCHAR_MAX); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+ fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value " } */
fuc (-1);
- fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
fuc (SCHAR_MIN);
- fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
- fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
+ fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
}
void fui (unsigned int);