aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr87837.c
blob: 5ee991c2baaf68b5f89a3beab43a7dddc8da168e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* PR sanitizer/87837 */
/* { dg-do run } */
/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable" } */

int
foo (int n)
{
  return n + __INT_MAX__ < n;
}

int
main ()
{
  volatile int a = foo (1);
  return 0;
}

/* { dg-output "signed integer overflow: 1 \\+ 2147483647 cannot be represented in type 'int'" } */