aboutsummaryrefslogtreecommitdiff
path: root/test/Format/inplace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Format/inplace.cpp')
-rw-r--r--test/Format/inplace.cpp264
1 files changed, 264 insertions, 0 deletions
diff --git a/test/Format/inplace.cpp b/test/Format/inplace.cpp
new file mode 100644
index 000000000000..175a8b65d7fd
--- /dev/null
+++ b/test/Format/inplace.cpp
@@ -0,0 +1,264 @@
+// Regression test to check that clang-format does not leave behind temporary
+// files on Windows when doing in-place formatting.
+// RUN: rm -rf %t.dir
+// RUN: mkdir %t.dir
+// RUN: cp %s %t.dir/inplace.cpp
+// RUN: clang-format -style=LLVM -i %t.dir/inplace.cpp
+// RUN: ls %t.dir > %t.dir/files.txt
+// RUN: FileCheck -strict-whitespace -input-file=%t.dir/files.txt %s
+
+// CHECK-NOT: RF{{.*}}.TMP
+
+// The file needs to be larger than 16kiB so that Windows creates a real file
+// mapping object for it.
+ int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;
+int this_is_my_int_there_are_many_like_it_but_this_one_is_mine;