Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / c-c++-common / Wshift-overflow-5.c
blobc9f464355dc0cd7401d5dd41a3f72668718798d3
1 /* PR c++/55095 */
2 /* { dg-do compile { target int32 } } */
3 /* { dg-options "-O -Wshift-overflow=2" } */
4 /* { dg-additional-options "-std=c++11" { target c++ } } */
6 #define INTM1 (sizeof (int) * __CHAR_BIT__ - 1)
7 #define LLONGM1 (sizeof (long long) * __CHAR_BIT__ - 1)
9 int i1 = 1 << INTM1; /* { dg-warning "requires 33 bits to represent" } */
10 unsigned u1 = 1 << INTM1; /* { dg-warning "requires 33 bits to represent" } */
11 long long int l1 = 1LL << LLONGM1; /* { dg-warning "requires 65 bits to represent" } */