aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-reorder-fields/AggregatePartialInitialization.c
blob: 7b531d9230c79b680322218b6c3403a9c3746448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// RUN: clang-reorder-fields -record-name Foo -fields-order z,y,x %s -- | FileCheck %s

struct Foo {
  int x;  // CHECK:       {{^  int z;}}
  int y;  // CHECK-NEXT:  {{^  int y;}}
  int z;  // CHECK-NEXT:  {{^  int x;}}
};

int main() {
  struct Foo foo = { 0, 1 }; // CHECK: {{^  struct Foo foo = { .y = 1, .x = 0 };}}
  return 0;
}