summaryrefslogtreecommitdiff
path: root/test/Format
diff options
context:
space:
mode:
authorPaul Hoad <mydeveloperday@gmail.com>2019-10-13 14:51:45 +0000
committerPaul Hoad <mydeveloperday@gmail.com>2019-10-13 14:51:45 +0000
commita4f23f4b48700a9c3a571df3a9601fd76ef3aea9 (patch)
tree556ae5decdf5b667a9e4f84e122bea6040b1fb3a /test/Format
parent7eb6c1f566606079400847c0ba8c9a59d84268a5 (diff)
downloadclang-a4f23f4b48700a9c3a571df3a9601fd76ef3aea9.tar.gz
[clang-format] Proposal for clang-format to give compiler style warnings
relanding {D68554} with fixed lit tests, checked on Windows and MacOS git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374720 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Format')
-rw-r--r--test/Format/dry-run-alias.cpp4
-rw-r--r--test/Format/dry-run.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/test/Format/dry-run-alias.cpp b/test/Format/dry-run-alias.cpp
new file mode 100644
index 0000000000..41ccc8f813
--- /dev/null
+++ b/test/Format/dry-run-alias.cpp
@@ -0,0 +1,4 @@
+// RUN: clang-format -style=LLVM -i -n %s 2> %t.stderr
+// RUN: grep -E "(.*)code should be clang-formatted(.*)" %t.stderr
+
+int a ;
diff --git a/test/Format/dry-run.cpp b/test/Format/dry-run.cpp
new file mode 100644
index 0000000000..78498a6bdf
--- /dev/null
+++ b/test/Format/dry-run.cpp
@@ -0,0 +1,4 @@
+// RUN: clang-format -style=LLVM -i --dry-run %s 2> %t.stderr
+// RUN: grep -E "(.*)code should be clang-formatted(.*)" %t.stderr
+
+int a ;