summaryrefslogtreecommitdiffstats
path: root/clang/test/Format/dump-config-objc.h
diff options
context:
space:
mode:
authorBen Hamilton <benhamilton@google.com>2018-01-29 17:36:43 +0000
committerBen Hamilton <benhamilton@google.com>2018-01-29 17:36:43 +0000
commit6845dec91715ee1fc9939053b8add76cacced6ef (patch)
tree594501728333bba476238c033a456233b2480a7c /clang/test/Format/dump-config-objc.h
parent073971b2435687727787675b55cf78655425311d (diff)
downloadbcm5719-llvm-6845dec91715ee1fc9939053b8add76cacced6ef.tar.gz
bcm5719-llvm-6845dec91715ee1fc9939053b8add76cacced6ef.zip
[clang-format] Fix bug where -dump-config failed on ObjC header
Summary: `clang-format -dump-config path/to/file.h` never passed anything for the Code parameter to clang::format::getStyle(). This meant the logic to guess Objective-C from the contents of a .h file never worked, because LibFormat didn't have the code to work with. With this fix, we now correctly read in the contents of the file if possible with -dump-config. I had to update the lit config for test/Format/ because the default config ignores .h files. Test Plan: make -j12 check-clang Reviewers: jolesiak, krasimir Reviewed By: jolesiak, krasimir Subscribers: Wizard, klimek, cfe-commits, djasper Differential Revision: https://reviews.llvm.org/D42395 llvm-svn: 323668
Diffstat (limited to 'clang/test/Format/dump-config-objc.h')
-rw-r--r--clang/test/Format/dump-config-objc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Format/dump-config-objc.h b/clang/test/Format/dump-config-objc.h
new file mode 100644
index 00000000000..d33fd366a40
--- /dev/null
+++ b/clang/test/Format/dump-config-objc.h
@@ -0,0 +1,5 @@
+// RUN: clang-format -dump-config %s | FileCheck %s
+
+// CHECK: Language: ObjC
+@interface Foo
+@end
OpenPOWER on IntegriCloud