1 /* { dg-do run } */
2 /* { dg-options "-fsanitize=integer-divide-by-zero -Wno-overflow" } */
3
4 #include <limits.h>
5
6 int
main(void)7 main (void)
8 {
9 volatile int min = INT_MIN;
10 volatile int zero = 0;
11
12 INT_MIN / -1;
13 min / -1;
14 min / (10 * zero - (2 - 1));
15
16 return 0;
17 }
18
19 /* { dg-output "division of -2147483648 by -1 cannot be represented in type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
20 /* { dg-output "\[^\n\r]*division of -2147483648 by -1 cannot be represented in type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
21 /* { dg-output "\[^\n\r]*division of -2147483648 by -1 cannot be represented in type 'int'\[^\n\r]*" } */
22