blob: ca4dd0e3943cb2b6cf28edd0b7485ec104352b60 [file] [log] [blame]
/* PR sanitizer/109107 */
/* { dg-do run { target int32 } } */
/* { dg-options "-fsanitize=signed-integer-overflow" } */
#define INT_MIN (-__INT_MAX__ - 1)
int a = INT_MIN;
const int b = 676540;
__attribute__((noipa)) int
foo ()
{
int c = a + 1 - (int) (short) b;
return c;
}
int
main ()
{
foo ();
return 0;
}
/* { dg-output "signed integer overflow: -2147483647 - 21180 cannot be represented in type 'int'" } */