1 | // RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,w,y,x %s -- | FileCheck %s |
---|---|
2 | |
3 | namespace bar { |
4 | struct 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 bar |
11 | |
12 | int main() { |
13 | const int x = 13; |
14 | bar::Foo foo = { .x: &x, .y: 0, .z: 1.29, .w: 17 }; // CHECK: {{^ bar::Foo foo = { 1.29, 17, 0, &x };}} |
15 | return 0; |
16 | } |
17 |