summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-reorder-fields/CStructFieldsOrder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-reorder-fields/CStructFieldsOrder.cpp')
-rw-r--r--clang-tools-extra/test/clang-reorder-fields/CStructFieldsOrder.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-reorder-fields/CStructFieldsOrder.cpp b/clang-tools-extra/test/clang-reorder-fields/CStructFieldsOrder.cpp
new file mode 100644
index 00000000000..2ed3578df65
--- /dev/null
+++ b/clang-tools-extra/test/clang-reorder-fields/CStructFieldsOrder.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,w,y,x %s -- | FileCheck %s
+
+namespace bar {
+struct Foo {
+ const int* x; // CHECK: {{^ double z;}}
+ int y; // CHECK-NEXT: {{^ int w;}}
+ double z; // CHECK-NEXT: {{^ int y;}}
+ int w; // CHECK-NEXT: {{^ const int\* x}}
+};
+} // end namespace bar
+
+int main() {
+ const int x = 13;
+ bar::Foo foo = { &x, 0, 1.29, 17 }; // CHECK: {{^ bar::Foo foo = { 1.29, 17, 0, &x };}}
+ return 0;
+}
OpenPOWER on IntegriCloud