Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / tools / clang / plugins / tests / enum_last_value_from_c.c
blob7fecbc0800085e9296d3c63da3d08f889ee18968
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // We warn when xxxLAST constants aren't last.
6 enum BadOne {
7 kBadOneInvalid = -1,
8 kBadOneRed,
9 kBadOneGreen,
10 kBadOneBlue,
11 kBadOneLast = kBadOneGreen
14 // We don't handle this case when called from C due to sign mismatch issues.
15 // No matter; we're not looking for this issue outside of C++.
16 enum FailOne {
17 FAIL_ONE_INVALID,
18 FAIL_ONE_RED,
19 FAIL_ONE_GREEN,
20 FAIL_ONE_BLUE = 0xfffffffc,
21 FAIL_ONE_LAST = FAIL_ONE_GREEN
24 // We don't warn when xxxLAST constants are last.
25 enum GoodOne {
26 kGoodOneInvalid = -1,
27 kGoodOneRed,
28 kGoodOneGreen,
29 kGoodOneBlue,
30 kGoodOneLast = kGoodOneBlue
33 // We don't warn when xxx_LAST constants are last.
34 enum GoodTwo {
35 GOOD_TWO_INVALID,
36 GOOD_TWO_RED,
37 GOOD_TWO_GREEN,
38 GOOD_TWO_BLUE = 0xfffffffc,
39 GOOD_TWO_LAST = GOOD_TWO_BLUE