Also now use -strict-whitespace as the tests are confusing otherwise.
llvm-svn: 177853
set(CLANG_TEST_DEPS
clang clang-headers
c-index-test diagtool arcmt-test c-arcmt-test
- clang-check
+ clang-check clang-format
)
set(CLANG_TEST_PARAMS
clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
--- /dev/null
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: clang-format -i %t.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
+
+// CHECK: {{^int\ \*i;}}
+ int * i ;
--- /dev/null
+// RUN: clang-format 2>&1 >/dev/null %s |FileCheck %s
+
+}
+// CHECK: diagnostic.cpp:[[@LINE-1]]:1: error: unexpected '}'
--- /dev/null
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: clang-format -offset=2 -length=0 -offset=28 -length=0 -i %t.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
+// CHECK: {{^int\ \*i;$}}
+ int*i;
+
+// CHECK: {{^\ \ int\ \ \*\ \ i;$}}
+ int * i;
+
+// CHECK: {{^\ \ int\ \*i;$}}
+ int * i;