aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-reorder-fields/FlexibleArrayMember.c
blob: ef64350fd08e68a8abbabe8b09a5d3f8df364b18 (plain)
1
2
3
4
5
6
7
8
9
10
// RUN: clang-reorder-fields -record-name Foo -fields-order z,y,x %s -- 2>&1 | FileCheck --check-prefix=CHECK-BAD %s
// RUN: clang-reorder-fields -record-name Foo -fields-order y,x,z %s -- | FileCheck --check-prefix=CHECK-GOOD %s

// CHECK-BAD: {{^Flexible array member must remain the last field in the struct}}

struct Foo {
  int x;   // CHECK-GOOD:      {{^  int y;}}
  int y;   // CHECK-GOOD-NEXT: {{^  int x;}}
  int z[]; // CHECK-GOOD-NEXT: {{^  int z\[\];}}
};