From 3a670eacf6ea1f33d5a2e2c2d70298545f5233b7 Mon Sep 17 00:00:00 2001 From: Douglas Yung Date: Thu, 28 Jun 2018 00:19:12 +0000 Subject: [PATCH] Fixup test to compile with -frtti when trying to use typeid() as the PS4 does not have it on by default and it was failing on the PS4 linux bot because of this. llvm-svn: 335799 --- .../unittests/clang-tidy/ExprMutationAnalyzerTest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clang-tools-extra/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp b/clang-tools-extra/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp index 25f1cac..498aa7c 100644 --- a/clang-tools-extra/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp @@ -579,8 +579,10 @@ TEST(ExprMutationAnalyzerTest, UnevaluatedExpressions) { Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); EXPECT_FALSE(isMutated(Results, AST.get())); - AST = tooling::buildASTFromCode("namespace std { class type_info; }" - "void f() { int x; typeid(x = 10); }"); + AST = + tooling::buildASTFromCodeWithArgs("namespace std { class type_info; }" + "void f() { int x; typeid(x = 10); }", + std::vector ({"-frtti"})); Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); EXPECT_FALSE(isMutated(Results, AST.get())); @@ -596,10 +598,11 @@ TEST(ExprMutationAnalyzerTest, NotUnevaluatedExpressions) { match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("x++")); - AST = tooling::buildASTFromCode( + AST = tooling::buildASTFromCodeWithArgs( "namespace std { class type_info; }" "struct A { virtual ~A(); }; struct B : A {};" - "struct X { A& f(); }; void f() { X x; typeid(x.f()); }"); + "struct X { A& f(); }; void f() { X x; typeid(x.f()); }", + std::vector ({"-frtti"})); Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("x.f()")); } -- 2.7.4