aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-07 15:17:23 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-07 15:17:23 +0000
commitefcfe733970b994b75ba5fc728a97357b3a6a0e1 (patch)
tree1019d4db570976b196812825d3fc6b4f1a982756 /unittests/Format/FormatTest.cpp
parentdecf7bcafd71af8c31cbc17eec1d6d050e2a1ea2 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 2d6a1426db..3a67e2dfa1 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/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