aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59333.c
blob: b68775702be1341419e879a04385f3e88f3cdb84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do run } */
/* { dg-options "-fsanitize=undefined" } */

long long int __attribute__ ((noinline, noclone))
foo (long long int i, long long int j)
{
  asm ("");
  return i + j;
}

int
main (void)
{
  foo (2LL, __LONG_LONG_MAX__);
  return 0;
}

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