summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-11-07 17:17:07 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-11-07 17:17:07 +0000
commit5a78985de7a9e13b4971c99145c3abd6aed0347f (patch)
tree0a80285140d0f7dc5c3370343f2a3bf99b4e4dac
parent0fe4d400ab05995727440620c25fe1d185b4e046 (diff)
downloadclang-5a78985de7a9e13b4971c99145c3abd6aed0347f.tar.gz
clang-5a78985de7a9e13b4971c99145c3abd6aed0347f.tar.bz2
clang-5a78985de7a9e13b4971c99145c3abd6aed0347f.tar.xz
Test for source location range of new expressions fixed in r167507.
Patch by Philip Craig. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167538 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--unittests/AST/SourceLocationTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/AST/SourceLocationTest.cpp b/unittests/AST/SourceLocationTest.cpp
index 73415b5b3d..7d6e0c3dad 100644
--- a/unittests/AST/SourceLocationTest.cpp
+++ b/unittests/AST/SourceLocationTest.cpp
@@ -248,5 +248,11 @@ TEST(ParmVarDecl, KNRRange) {
EXPECT_TRUE(Verifier.match("void f(i) {}", varDecl(), Lang_C));
}
+TEST(CXXNewExpr, ArrayRange) {
+ RangeVerifier<CXXNewExpr> Verifier;
+ Verifier.expectRange(1, 12, 1, 22);
+ EXPECT_TRUE(Verifier.match("void f() { new int[10]; }", newExpr()));
+}
+
} // end namespace ast_matchers
} // end namespace clang