Erik Pilkington | 3e4e3b1 | 2018-09-05 19:13:27 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify -Wswitch -triple x86_64-apple-macosx10.12 %s |
| 2 | |
| 3 | enum SwitchOne { |
| 4 | Unavail __attribute__((availability(macos, unavailable))), |
| 5 | }; |
| 6 | |
| 7 | void testSwitchOne(enum SwitchOne so) { |
| 8 | switch (so) {} // no warning |
| 9 | } |
| 10 | |
| 11 | enum SwitchTwo { |
| 12 | Ed __attribute__((availability(macos, deprecated=10.12))), |
| 13 | Vim __attribute__((availability(macos, deprecated=10.13))), |
| 14 | Emacs, |
| 15 | }; |
| 16 | |
| 17 | void testSwitchTwo(enum SwitchTwo st) { |
| 18 | switch (st) {} // expected-warning{{enumeration values 'Vim' and 'Emacs' not handled in switch}} |
| 19 | } |
| 20 | |
| 21 | enum SwitchThree { |
| 22 | New __attribute__((availability(macos, introduced=1000))), |
| 23 | }; |
| 24 | |
| 25 | void testSwitchThree(enum SwitchThree st) { |
| 26 | switch (st) {} // expected-warning{{enumeration value 'New' not handled in switch}} |
| 27 | } |