[clang-tools-extra] r335799 - 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.

Douglas Yung via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 27 17:19:12 PDT 2018


Author: dyung
Date: Wed Jun 27 17:19:12 2018
New Revision: 335799

URL: http://llvm.org/viewvc/llvm-project?rev=335799&view=rev
Log:
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.

Modified:
    clang-tools-extra/trunk/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp

Modified: clang-tools-extra/trunk/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp?rev=335799&r1=335798&r2=335799&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/ExprMutationAnalyzerTest.cpp Wed Jun 27 17:19:12 2018
@@ -579,8 +579,10 @@ TEST(ExprMutationAnalyzerTest, Unevaluat
   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<std::string> ({"-frtti"}));
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
@@ -596,10 +598,11 @@ TEST(ExprMutationAnalyzerTest, NotUneval
       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<std::string> ({"-frtti"}));
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("x.f()"));
 }




More information about the cfe-commits mailing list