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