1/* { dg-do run } */
2/* { dg-options "-fsanitize=undefined -fno-sanitize-recover=signed-integer-overflow" } */
3/* { dg-additional-options "-std=gnu11" { target c } } */
4/* { dg-additional-options "-std=c++11" { target c++ } } */
5
6volatile int w, z;
7
8__attribute__ ((noinline, noclone)) int
9foo (int x, int y)
10{
11  z++;
12  return x << y;
13}
14
15int
16main ()
17{
18  w = foo (0, -__INT_MAX__);
19  return 0;
20}
21
22/* { dg-output "shift exponent -\[^\n\r]* is negative\[^\n\r]*(\n|\r\n|\r)" } */
23