17 lines · cpp
1// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,w,y,x %s -- | FileCheck %s2 3namespace bar {4struct Foo {5 const int* x; // CHECK: {{^ double z;}}6 int y; // CHECK-NEXT: {{^ int w;}}7 double z; // CHECK-NEXT: {{^ int y;}}8 int w; // CHECK-NEXT: {{^ const int\* x}}9};10} // end namespace bar11 12int main() {13 const int x = 13;14 bar::Foo foo = { &x, 0, 1.29, 17 }; // CHECK: {{^ bar::Foo foo = { 1.29, 17, 0, &x };}} 15 return 0;16}17