================ @@ -0,0 +1,160 @@ +//===- unittests/Interpreter/OutOfProcessInterpreterTest.cpp --- Interpreter +// tests when Out-of-Process ----===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// Unit tests for Clang's Interpreter library. +// +//===----------------------------------------------------------------------===// + +#include "InterpreterTestFixture.h" + +#include "clang/AST/Decl.h" +#include "clang/AST/DeclGroup.h" +#include "clang/AST/Mangle.h" +#include "clang/Basic/Version.h" +#include "clang/Config/config.h" +#include "clang/Frontend/CompilerInstance.h" +#include "clang/Frontend/TextDiagnosticPrinter.h" +#include "clang/Interpreter/Interpreter.h" +#include "clang/Interpreter/RemoteJITUtils.h" +#include "clang/Interpreter/Value.h" +#include "clang/Sema/Lookup.h" +#include "clang/Sema/Sema.h" +#include "llvm/Support/Error.h" +#include "llvm/TargetParser/Host.h" + +#include "llvm/TargetParser/Host.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +using namespace clang; + +llvm::ExitOnError ExitOnError; + +#ifdef _WIN32 +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 +#endif + +namespace { + +class InterpreterRemoteTest : public InterpreterTestBase { + // TODO: Collect common variables and utility functions here +}; + +using Args = std::vector<const char *>; + +static std::string getExecutorPath() { + llvm::SmallString<256> ExecutorPath(llvm::sys::fs::getMainExecutable( + nullptr, reinterpret_cast<void *>(&getExecutorPath))); + llvm::sys::path::remove_filename(ExecutorPath); + + llvm::sys::path::remove_filename(ExecutorPath); // Remove "Interpreter" + llvm::sys::path::remove_filename(ExecutorPath); // Remove "unittests" + llvm::sys::path::remove_filename(ExecutorPath); // Remove "clang" + llvm::sys::path::remove_filename(ExecutorPath); // Remove "tools" ---------------- vgvassilev wrote:
We should move that into a separate function to avoid the code duplication. https://github.com/llvm/llvm-project/pull/147478 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits