11 lines · c
1// RUN: clang-reorder-fields -record-name Foo -fields-order z,y,x %s -- 2>&1 | FileCheck --check-prefix=CHECK-BAD %s2// RUN: clang-reorder-fields -record-name Foo -fields-order y,x,z %s -- | FileCheck --check-prefix=CHECK-GOOD %s3 4// CHECK-BAD: {{^Flexible array member must remain the last field in the struct}}5 6struct Foo {7 int x; // CHECK-GOOD: {{^ int y;}}8 int y; // CHECK-GOOD-NEXT: {{^ int x;}}9 int z[]; // CHECK-GOOD-NEXT: {{^ int z\[\];}}10};11