Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.dg/c2x-attr-fallthrough-4.c
2023-03-06 14:48:14 +01:00

20 lines
446 B
C

/* Test C2x fallthrough attribute: duplicates (allowed after N2557). */
/* { dg-do compile } */
/* { dg-options "-std=c2x -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;
}