view gcc/testsuite/c-c++-common/pr30020.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR c/30020 */
/* { dg-do compile } */

int
foo (unsigned char c)
{
  switch (c) { case 42: case -1: return -1; }; /* { dg-warning "25:case label value" } */
  switch (c) { case 42: case 300: return -1; }; /* { dg-warning "25:case label value" } */
  switch (c) { case 42: case -1 ... 2: return -1; }; /* { dg-warning "25:lower value in case" } */
  switch (c) { case 42: case 250 ... 300: return -1; }; /* { dg-warning "25:upper value in case" } */
  return 0;
}