diff options
author | Alexander Shaposhnikov <shal1t712@gmail.com> | 2017-07-20 21:41:20 +0000 |
---|---|---|
committer | Alexander Shaposhnikov <shal1t712@gmail.com> | 2017-07-20 21:41:20 +0000 |
commit | eaf833ca2bb35323cfcb333b0ec71f1adc35b530 (patch) | |
tree | 4bfa24bdf4195c6743dfcc7262bb0210afd61908 /clang-tools-extra/test/clang-reorder-fields/PlainCStructFieldsOrder.c | |
parent | 6d8fb107b271deb73abd31b20fb4b113c973b825 (diff) | |
download | bcm5719-llvm-eaf833ca2bb35323cfcb333b0ec71f1adc35b530.tar.gz bcm5719-llvm-eaf833ca2bb35323cfcb333b0ec71f1adc35b530.zip |
[clang-tools-extra] Add support for plain C structs in clang-reorder-fields
This diff updates the tool clang-reorder-fields
to enable reordering of fields of plain C structs.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D35329
llvm-svn: 308678
Diffstat (limited to 'clang-tools-extra/test/clang-reorder-fields/PlainCStructFieldsOrder.c')
-rw-r--r-- | clang-tools-extra/test/clang-reorder-fields/PlainCStructFieldsOrder.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-reorder-fields/PlainCStructFieldsOrder.c b/clang-tools-extra/test/clang-reorder-fields/PlainCStructFieldsOrder.c new file mode 100644 index 00000000000..5b4fe9e654e --- /dev/null +++ b/clang-tools-extra/test/clang-reorder-fields/PlainCStructFieldsOrder.c @@ -0,0 +1,14 @@ +// RUN: clang-reorder-fields -record-name Foo -fields-order z,w,y,x %s -- | FileCheck %s + +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}} +}; + +int main() { + const int x = 13; + struct Foo foo = { &x, 0, 1.29, 17 }; // CHECK: {{^ struct Foo foo = { 1.29, 17, 0, &x };}} + return 0; +} |