aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Format/multiple-inputs-error.cpp6
-rw-r--r--test/Format/multiple-inputs-inplace.cpp8
-rw-r--r--test/Format/multiple-inputs.cpp7
3 files changed, 21 insertions, 0 deletions
diff --git a/test/Format/multiple-inputs-error.cpp b/test/Format/multiple-inputs-error.cpp
new file mode 100644
index 0000000000..71f87e0b15
--- /dev/null
+++ b/test/Format/multiple-inputs-error.cpp
@@ -0,0 +1,6 @@
+// RUN: cp %s %t-1.cpp
+// RUN: cp %s %t-2.cpp
+// RUN: clang-format 2>&1 >/dev/null -offset=1 -length=0 %t-1.cpp %t-2.cpp |FileCheck %s
+// CHECK: error: "-offset" and "-length" can only be used for single file.
+
+int i ;
diff --git a/test/Format/multiple-inputs-inplace.cpp b/test/Format/multiple-inputs-inplace.cpp
new file mode 100644
index 0000000000..74c30db71e
--- /dev/null
+++ b/test/Format/multiple-inputs-inplace.cpp
@@ -0,0 +1,8 @@
+// RUN: cp %s %t-1.cpp
+// RUN: cp %s %t-2.cpp
+// RUN: clang-format -style=LLVM -i %t-1.cpp %t-2.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t-1.cpp %s
+// RUN: FileCheck -strict-whitespace -input-file=%t-2.cpp %s
+
+// CHECK: {{^int\ \*i;}}
+ int * i ;
diff --git a/test/Format/multiple-inputs.cpp b/test/Format/multiple-inputs.cpp
new file mode 100644
index 0000000000..df267149fe
--- /dev/null
+++ b/test/Format/multiple-inputs.cpp
@@ -0,0 +1,7 @@
+// RUN: cp %s %t-1.cpp
+// RUN: cp %s %t-2.cpp
+// RUN: clang-format -style=LLVM %t-1.cpp %t-2.cpp|FileCheck -strict-whitespace %s
+
+// CHECK: {{^int\ \*i;}}
+// CHECK: {{^int\ \*i;}}
+ int * i ;