[PATCH] Add -frtti and -fexceptions to tests that assume these are on.

Filipe Cabecinhas filcab+llvm.phabricator at gmail.com
Wed Feb 25 16:43:34 PST 2015


Hi klimek, thakis, djasper,

We now have targets that don't enable rtti/exceptions by default, and the
ASTMatchers tests are assuming that these features are on (e.g: They use
dynamic_cast or try).

http://reviews.llvm.org/D7892

Files:
  unittests/ASTMatchers/ASTMatchersTest.h

Index: unittests/ASTMatchers/ASTMatchersTest.h
===================================================================
--- unittests/ASTMatchers/ASTMatchersTest.h
+++ unittests/ASTMatchers/ASTMatchersTest.h
@@ -73,7 +73,11 @@
   std::unique_ptr<FrontendActionFactory> Factory(
       newFrontendActionFactory(&Finder));
   // Some tests use typeof, which is a gnu extension.
-  std::vector<std::string> Args(1, CompileArg);
+  std::vector<std::string> Args;
+  Args.push_back(CompileArg);
+  // Some tests need rtti/exceptions on
+  Args.push_back("-frtti");
+  Args.push_back("-fexceptions");
   if (!runToolOnCodeWithArgs(Factory->create(), Code, Args, "input.cc",
                              VirtualMappedFiles)) {
     return testing::AssertionFailure() << "Parsing error in \"" << Code << "\"";

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7892.20719.patch
Type: text/x-patch
Size: 798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150226/2c54b283/attachment.bin>


More information about the cfe-commits mailing list