]> granicus.if.org Git - clang/commitdiff
Test for empty .clang-format file.
authorAlexander Kornienko <alexfh@google.com>
Mon, 2 Sep 2013 13:44:16 +0000 (13:44 +0000)
committerAlexander Kornienko <alexfh@google.com>
Mon, 2 Sep 2013 13:44:16 +0000 (13:44 +0000)
Summary: Test clang-format's handling of empty .clang-format files.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1562

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189757 91177308-0d34-0410-b5e6-96231b3b80d8

test/Format/style-on-command-line.cpp

index 6f81b9bf723e99224e499147d131fe157468babf..044264b916053a0ed1c3583bf420f0d17fdb38c8 100644 (file)
@@ -6,6 +6,8 @@
 // RUN: [ ! -e %T/.clang-format ] || rm %T/.clang-format
 // RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %T/.clang-format
 // RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK5 %s
+// RUN: printf "\n" > %T/.clang-format
+// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s
 void f() {
 // CHECK1: {{^        int\* i;$}}
 // CHECK2: {{^       int \*i;$}}
@@ -15,6 +17,8 @@ void f() {
 // CHECK4: Error parsing -style: Invalid argument, using LLVM style
 // CHECK4: {{^  int \*i;$}}
 // CHECK5: {{^     int\* i;$}}
+// CHECK6: Can't find usable .clang-format, using LLVM style
+// CHECK6: {{^  int \*i;$}}
 int*i;
 int j;
 }