[PATCH] D76433: [Syntax] Make TreeTest independent from the host platform.

Marcel Hlopko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 19 08:37:27 PDT 2020


hlopko created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
hlopko added a parent revision: D76366: [Syntax] Split syntax tests.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76433

Files:
  clang/unittests/Tooling/Syntax/TreeTest.cpp


Index: clang/unittests/Tooling/Syntax/TreeTest.cpp
===================================================================
--- clang/unittests/Tooling/Syntax/TreeTest.cpp
+++ clang/unittests/Tooling/Syntax/TreeTest.cpp
@@ -98,8 +98,12 @@
     if (!Diags->getClient())
       Diags->setClient(new IgnoringDiagConsumer);
     // Prepare to run a compiler.
-    std::vector<const char *> Args = {"syntax-test", "-std=c++11",
-                                      "-fsyntax-only", FileName};
+    std::vector<const char *> Args = {
+      "syntax-test", "-std=c++11",
+      // Hard-setting target so the unit test behavior doesn't depend on the
+      // host.
+      "-target", "x86_64-unknown-unknown",
+      "-fsyntax-only", FileName};
     Invocation = createInvocationFromCommandLine(Args, Diags, FS);
     assert(Invocation);
     Invocation->getFrontendOpts().DisableFree = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76433.251390.patch
Type: text/x-patch
Size: 883 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200319/5e0cdd0d/attachment-0001.bin>


More information about the cfe-commits mailing list