[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Format / access-modifiers.cpp
blob8bd98409e9f701bd353532309f7f68de7ad9221e
1 // RUN: grep -Ev "// *[A-Z-]+:" %s \
2 // RUN: | clang-format -style="{BasedOnStyle: LLVM, EmptyLineBeforeAccessModifier: LogicalBlock}" -lines=1:14 \
3 // RUN: | clang-format -style="{BasedOnStyle: LLVM, EmptyLineBeforeAccessModifier: Never}" -lines=14:40 \
4 // RUN: | FileCheck -strict-whitespace %s
6 // CHECK: int i
7 // CHECK-NEXT: {{^$}}
8 // CHECK-NEXT: {{^private:$}}
9 // CHECK: }
10 struct foo1 {
11 int i;
13 private:
14 int j;
17 // CHECK: struct bar1
18 // CHECK-NEXT: {{^private:$}}
19 // CHECK: }
20 struct bar1 {
21 private:
22 int i;
23 int j;
26 // CHECK: int i
27 // CHECK-NEXT: {{^private:$}}
28 // CHECK: }
29 struct foo2 {
30 int i;
32 private:
33 int j;
36 // CHECK: struct bar2
37 // CHECK-NEXT: {{^private:$}}
38 // CHECK: }
39 struct bar2 {
40 private:
41 int i;
42 int j;
45 // CHECK: int j
46 // CHECK-NEXT: {{^private:$}}
47 // CHECK: }
48 struct foo3 {
49 int i;
50 int j;
52 private:
55 // CHECK: struct bar3
56 // CHECK-NEXT: {{^private:$}}
57 // CHECK: }
58 struct bar3 {
60 private:
61 int i;
62 int j;