1  /* { dg-do run } */
       2  /* { dg-options "-fsanitize=shift -w" } */
       3  
       4  typedef const unsigned long long int CULLI;
       5  typedef volatile int VI;
       6  struct s { signed long int a; };
       7  
       8  int
       9  main (void)
      10  {
      11    int a = 1;
      12    struct s s = { .a = 400 };
      13    CULLI culli = 42;
      14    VI vi = 370;
      15    volatile int shiftcount = 153;
      16  
      17    a <<= 152;
      18    1 << shiftcount;
      19    1 << 154;
      20    culli << 524;
      21    1 << vi++;
      22    (long) 1 << (s.a + 2);
      23  
      24    return 0;
      25  }
      26  /* { dg-output "shift exponent 152 is too large for \[^\n\r]*-bit type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
      27  /* { dg-output "\[^\n\r]*shift exponent 153 is too large for \[^\n\r]*-bit type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
      28  /* { dg-output "\[^\n\r]*shift exponent 154 is too large for \[^\n\r]*-bit type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
      29  /* { dg-output "\[^\n\r]*shift exponent 524 is too large for \[^\n\r]*-bit type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
      30  /* { dg-output "\[^\n\r]*shift exponent 370 is too large for \[^\n\r]*-bit type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
      31  /* { dg-output "\[^\n\r]*shift exponent 402 is too large for \[^\n\r]*-bit type 'long int'" } */