diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-01-07 15:17:23 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-01-07 15:17:23 +0000 |
commit | a887650cf6449bb300cf9d64776ed37fc1dc5a7c (patch) | |
tree | 27753e8c86c505c70ca5854f415e1651cd28318b /clang/unittests/Format/FormatTest.cpp | |
parent | 683ff2d7f96526a92412f2c6da6ec49ba5017512 (diff) | |
download | bcm5719-llvm-a887650cf6449bb300cf9d64776ed37fc1dc5a7c.tar.gz bcm5719-llvm-a887650cf6449bb300cf9d64776ed37fc1dc5a7c.zip |
Add a test that checks that the formatter doesn't discard '@' with ObjC1 set.
Also set ObjC1 in the formatter tests.
The only effect of this flag in the lexer is that '@' now gets turned into
tok::at instead of tok::unknown.
llvm-svn: 171742
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 2d6a1426db4..3a67e2dfa18 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -29,6 +29,7 @@ protected: LangOptions LangOpts; LangOpts.CPlusPlus = 1; LangOpts.CPlusPlus11 = 1; + LangOpts.ObjC1 = 1; Lexer Lex(ID, Context.Sources.getBuffer(ID), Context.Sources, LangOpts); tooling::Replacements Replace = reformat(Style, Lex, Context.Sources, Ranges); @@ -1020,5 +1021,10 @@ TEST_F(FormatTest, FormatForObjectiveCMethodDecls) { "outRange8:(NSRange) out_range8 outRange9:(NSRange) out_range9;")); } +TEST_F(FormatTest, DoNotDropAt) { + verifyFormat("@interface"); + verifyFormat("@dynamic"); +} + } // end namespace tooling } // end namespace clang |