David Blaikie | 2dd52e3 | 2012-01-24 05:34:08 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify -Wno-covered-switch-default %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Gabor Greif | 28164ab | 2010-10-01 22:05:14 +0000 | [diff] [blame] | 3 | |
4 | enum E { | ||||
5 | one, | ||||
6 | two, | ||||
7 | three, | ||||
8 | four | ||||
9 | }; | ||||
10 | |||||
11 | |||||
12 | int test(enum E e) | ||||
13 | { | ||||
14 | switch (e) | ||||
15 | { | ||||
16 | case one: | ||||
17 | return 7; | ||||
18 | case two ... two + 1: | ||||
19 | return 42; | ||||
20 | case four: | ||||
21 | return 25; | ||||
22 | default: | ||||
23 | return 0; | ||||
24 | } | ||||
25 | } |