[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.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 05:08:58 PDT 2018


Thank you for fixing the test!

On Thu, Jun 28, 2018 at 2:23 AM Douglas Yung via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> 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()"));
>  }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180628/28172ea6/attachment-0001.html>


More information about the cfe-commits mailing list