xref: /llvm-project/clang-tools-extra/test/clang-reorder-fields/ClassDifferentFieldsAccesses.cpp (revision bf3c84cff7fdd767bb8228bb0dfde3b385eedf04)
1*bf3c84cfSAlexander Shaposhnikov // RUN: clang-reorder-fields -record-name Foo -fields-order z,y,x %s -- | FileCheck %s
2*bf3c84cfSAlexander Shaposhnikov 
3*bf3c84cfSAlexander Shaposhnikov // The order of fields should not change.
4*bf3c84cfSAlexander Shaposhnikov class Foo {
5*bf3c84cfSAlexander Shaposhnikov public:
6*bf3c84cfSAlexander Shaposhnikov   int x;  // CHECK:       {{^  int x;}}
7*bf3c84cfSAlexander Shaposhnikov 
8*bf3c84cfSAlexander Shaposhnikov private:
9*bf3c84cfSAlexander Shaposhnikov   int y;  // CHECK:       {{^  int y;}}
10*bf3c84cfSAlexander Shaposhnikov   int z;  // CHECK-NEXT:  {{^  int z;}}
11*bf3c84cfSAlexander Shaposhnikov };
12*bf3c84cfSAlexander Shaposhnikov 
main()13*bf3c84cfSAlexander Shaposhnikov int main() {
14*bf3c84cfSAlexander Shaposhnikov   Foo foo;
15*bf3c84cfSAlexander Shaposhnikov   return 0;
16*bf3c84cfSAlexander Shaposhnikov }
17