aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-attr-fallthrough-4.c
blob: 1f425174d4eb82f03f26f9c363dfe58bdc78a476 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Test C23 fallthrough attribute: duplicates (allowed after N2557).  */
/* { dg-do compile } */
/* { dg-options "-std=c23 -pedantic-errors" } */

int
f (int a)
{
  switch (a)
    {
    case 1:
      a++;
      [[fallthrough, __fallthrough__]]; /* { dg-warning "specified multiple times" } */
    case 2:
      a++;
      [[fallthrough]] [[fallthrough]]; /* { dg-warning "specified multiple times" } */
    case 3:
      a++;
    }
  return a;
}