* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / overflow-negate-3.c
blob85acce8e729b30e21882268f4c187073b4e8ef1b
1 /* { dg-do run } */
2 /* { dg-options "-fsanitize=signed-integer-overflow" } */
4 #define INT_MIN (-__INT_MAX__ - 1)
6 int
7 main ()
9 int x = INT_MIN;
10 int y;
11 asm ("" : "+g" (x));
12 y = -(-x);
13 asm ("" : "+g" (y));
14 y = -(-INT_MIN);
15 asm ("" : "+g" (y));
18 /* { dg-output "negation of -2147483648 cannot be represented in type 'int'\[^\n\r]*; cast to an unsigned type to negate this value to itself\[^\n\r]*(\n|\r\n|\r)" } */
19 /* { dg-output "\[^\n\r]*negation of -2147483648 cannot be represented in type 'int'\[^\n\r]*; cast to an unsigned type to negate this value to itself\[^\n\r]*(\n|\r\n|\r)" } */
20 /* { dg-output "\[^\n\r]*negation of -2147483648 cannot be represented in type 'int'\[^\n\r]*; cast to an unsigned type to negate this value to itself\[^\n\r]*(\n|\r\n|\r)" } */
21 /* { dg-output "\[^\n\r]*negation of -2147483648 cannot be represented in type 'int'\[^\n\r]*; cast to an unsigned type to negate this value to itself" } */