aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Format/access-modifiers.cpp
blob: 8bd98409e9f701bd353532309f7f68de7ad9221e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// RUN: grep -Ev "// *[A-Z-]+:" %s \
// RUN:   | clang-format -style="{BasedOnStyle: LLVM, EmptyLineBeforeAccessModifier: LogicalBlock}" -lines=1:14 \
// RUN:   | clang-format -style="{BasedOnStyle: LLVM, EmptyLineBeforeAccessModifier: Never}" -lines=14:40 \
// RUN:   | FileCheck -strict-whitespace %s

// CHECK: int i
// CHECK-NEXT: {{^$}}
// CHECK-NEXT: {{^private:$}}
// CHECK: }
struct foo1 {
  int i;

private:
  int j;
};

// CHECK: struct bar1
// CHECK-NEXT: {{^private:$}}
// CHECK: }
struct bar1 {
private:
  int i;
  int j;
};

// CHECK: int i
// CHECK-NEXT: {{^private:$}}
// CHECK: }
struct foo2 {
  int i;

private:
  int j;
};

// CHECK: struct bar2
// CHECK-NEXT: {{^private:$}}
// CHECK: }
struct bar2 {
private:
  int i;
  int j;
};

// CHECK: int j
// CHECK-NEXT: {{^private:$}}
// CHECK: }
struct foo3 {
  int i;
  int j;

private:
};

// CHECK: struct bar3
// CHECK-NEXT: {{^private:$}}
// CHECK: }
struct bar3 {

private:
  int i;
  int j;
};