(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
ubsan/
shift-2.c
       1  /* { dg-do run } */
       2  /* { dg-options "-fsanitize=shift -w" } */
       3  
       4  int
       5  main (void)
       6  {
       7    int a = 1;
       8    volatile int b = -5;
       9    long long int c = -6;
      10  
      11    a << -3;
      12    1 << -4;
      13    1 << b;
      14    a << c;
      15    a << (b + c);
      16  
      17    return 0;
      18  }
      19  /* { dg-output "shift exponent -3 is negative\[^\n\r]*(\n|\r\n|\r)" } */
      20  /* { dg-output "\[^\n\r]*shift exponent -4 is negative\[^\n\r]*(\n|\r\n|\r)" } */
      21  /* { dg-output "\[^\n\r]*shift exponent -5 is negative\[^\n\r]*(\n|\r\n|\r)" } */
      22  /* { dg-output "\[^\n\r]*shift exponent -6 is negative\[^\n\r]*(\n|\r\n|\r)" } */
      23  /* { dg-output "\[^\n\r]*shift exponent -11 is negative" } */