aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/analyzer/switch-wrong-enum.c
blob: 0de25168a65c825192c8f03db28765f1d5849e9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "analyzer-decls.h"

enum color
{
 RED,
 GREEN,
 BLUE
};

enum fruit
{
 APPLE,
 BANANA
};

int test_wrong_enum (enum color x)
{
  switch (x)
    {
    case APPLE:
      return 1066;
    case BANANA:
      return 1776;
    }
  __analyzer_dump_path (); /* { dg-message "path" } */
  return 0;
}