summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c99-left-shift-3.c
blob: 59d0f24e39d4044a0c433061e8fb82485777e8f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors -Wno-shift-overflow" } */

#define INTM1 (sizeof (int) * __CHAR_BIT__ - 1)

enum { A = 1 << INTM1 }; /* { dg-error "constant expression" } */
int k = 1 << INTM1; /* { dg-error "constant expression" } */

void
fn (int i)
{
  switch (i)
  case 1 << INTM1: break; /* { dg-error "constant expression" } */
}