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

namespace bar {

#define DEFINE_FIELDS

// This is okay to reorder.
struct Foo {
#ifdef DEFINE_FIELDS // CHECK:      {{^#ifdef DEFINE_FIELDS}}
  int x;             // CHECK-NEXT: {{^ int y;}}
  int y;             // CHECK-NEXT: {{^ int x;}}
#endif               // CHECK-NEXT: {{^#endif}}
};

} // end namespace bar