summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/case-const-2.c
blob: 9c119b04df536950411a022d6f0f3c8687bc92ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Test for case labels not integer constant expressions but folding
   to integer constants (used in Linux kernel, PR 39613).  */
/* { dg-do compile } */
/* { dg-options "-pedantic" } */

extern int i;
void
f (int c)
{
  switch (c)
    {
    case (1 ? 1 : i): /* { dg-warning "case label is not an integer constant expression" } */
      ;
    }
}