summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-11-16 12:38:56 +0000
committerDaniel Jasper <djasper@google.com>2015-11-16 12:38:56 +0000
commitda446770823be1b1d1562734e55da7c1a5f2579c (patch)
tree2bf41eaac2d5dcd6b8181359a850bbd26e037fe4 /clang/test
parentbc09f39476723d319feaac18c948cd3498681136 (diff)
downloadbcm5719-llvm-da446770823be1b1d1562734e55da7c1a5f2579c.tar.gz
bcm5719-llvm-da446770823be1b1d1562734e55da7c1a5f2579c.zip
clang-format: Enable #include sorting by default.
This has seen quite some usage and I am not aware of any issues. Also add a style option to enable/disable include sorting. The existing command line flag can from now on be used to override whatever is set in the style. llvm-svn: 253202
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Format/disable-include-sorting.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Format/disable-include-sorting.cpp b/clang/test/Format/disable-include-sorting.cpp
new file mode 100644
index 00000000000..875a0af400e
--- /dev/null
+++ b/clang/test/Format/disable-include-sorting.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-format %s | FileCheck %s
+// RUN: clang-format %s -sort-includes -style="{SortIncludes: false}" | FileCheck %s
+// RUN: clang-format %s -sort-includes=false | FileCheck %s -check-prefix=NOT-SORTED
+
+#include <b>
+#include <a>
+// CHECK: <a>
+// CHECK-NEXT: <b>
+// NOT-SORTED: <b>
+// NOT-SORTED-NEXT: <a>
OpenPOWER on IntegriCloud