aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-reorder-fields/PreprocessorDirectiveInDefinition.cpp
blob: fee6b0e637b9b9d4fdc574c9d2afdea541aa43a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,y,x %s -- | FileCheck %s

namespace bar {

#define ADD_Z

// The order of fields should not change.
struct Foo {
  int x;     // CHECK:      {{^ int x;}}
  int y;     // CHECK-NEXT: {{^ int y;}}
#ifdef ADD_Z // CHECK-NEXT: {{^#ifdef ADD_Z}}
  int z;     // CHECK-NEXT: {{^ int z;}}
#endif       // CHECK-NEXT: {{^#endif}}
};

} // end namespace bar