aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr82072-2.c
blob: ff8aca4d94291a1051c35823e6bc21e89d92008f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* PR sanitizer/82072 */
/* { dg-do run } */
/* { dg-options "-fsanitize=signed-integer-overflow" } */

int
main ()
{
  long long int l = -__LONG_LONG_MAX__ - 1;
  unsigned int u;
  u = -l;
  asm volatile ("" : "+r" (u));
  return 0;
}

/* { dg-output "negation of -9223372036854775808 cannot be represented in type 'long long int'\[^\n\r]*; cast to an unsigned type to negate this value to itself" } */