annotate clang/test/Sema/switch-availability.c @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -verify -Wswitch -triple x86_64-apple-macosx10.12 %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 enum SwitchOne {
anatofuz
parents:
diff changeset
4 Unavail __attribute__((availability(macos, unavailable))),
anatofuz
parents:
diff changeset
5 };
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 void testSwitchOne(enum SwitchOne so) {
anatofuz
parents:
diff changeset
8 switch (so) {} // no warning
anatofuz
parents:
diff changeset
9 }
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 enum SwitchTwo {
anatofuz
parents:
diff changeset
12 Ed __attribute__((availability(macos, deprecated=10.12))),
anatofuz
parents:
diff changeset
13 Vim __attribute__((availability(macos, deprecated=10.13))),
anatofuz
parents:
diff changeset
14 Emacs,
anatofuz
parents:
diff changeset
15 };
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 void testSwitchTwo(enum SwitchTwo st) {
anatofuz
parents:
diff changeset
18 switch (st) {} // expected-warning{{enumeration values 'Vim' and 'Emacs' not handled in switch}}
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 enum SwitchThree {
anatofuz
parents:
diff changeset
22 New __attribute__((availability(macos, introduced=1000))),
anatofuz
parents:
diff changeset
23 };
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 void testSwitchThree(enum SwitchThree st) {
anatofuz
parents:
diff changeset
26 switch (st) {} // expected-warning{{enumeration value 'New' not handled in switch}}
anatofuz
parents:
diff changeset
27 }