]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Analysis/copypaste/attributes.cpp
Vendor import of clang trunk r290819:
[FreeBSD/FreeBSD.git] / test / Analysis / copypaste / attributes.cpp
1 // RUN: %clang_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s
2
3 // expected-no-diagnostics
4
5 int foo1(int n) {
6   int result = 0;
7   switch (n) {
8   case 33:
9     result += 33;
10     [[clang::fallthrough]];
11   case 44:
12     result += 44;
13   }
14   return result;
15 }
16
17 // Identical to foo1 except the missing attribute.
18 int foo2(int n) {
19   int result = 0;
20   switch (n) {
21   case 33:
22     result += 33;
23     ;
24   case 44:
25     result += 44;
26   }
27   return result;
28 }