aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clang/unittests/Interpreter/CodeCompletionTest.cpp16
-rw-r--r--clang/unittests/Interpreter/IncrementalProcessingTest.cpp3
-rw-r--r--clang/unittests/Interpreter/InterpreterExtensionsTest.cpp2
-rw-r--r--clang/unittests/Interpreter/InterpreterTest.cpp7
-rw-r--r--clang/unittests/Interpreter/InterpreterTestFixture.h12
5 files changed, 13 insertions, 27 deletions
diff --git a/clang/unittests/Interpreter/CodeCompletionTest.cpp b/clang/unittests/Interpreter/CodeCompletionTest.cpp
index 1dbd983d..72fcce7 100644
--- a/clang/unittests/Interpreter/CodeCompletionTest.cpp
+++ b/clang/unittests/Interpreter/CodeCompletionTest.cpp
@@ -5,10 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
-// Unit tests for Clang's Interpreter library.
-//
-//===----------------------------------------------------------------------===//
#include "InterpreterTestFixture.h"
@@ -18,9 +14,7 @@
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/CodeCompleteConsumer.h"
#include "clang/Sema/Sema.h"
-#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/LineEditor/LineEditor.h"
-#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"
#include "gmock/gmock.h"
@@ -32,12 +26,14 @@ auto CB = clang::IncrementalCompilerBuilder();
class CodeCompletionTest : public InterpreterTestBase {
public:
- std::unique_ptr<CompilerInstance> CI;
std::unique_ptr<Interpreter> Interp;
- CodeCompletionTest()
- : CI(cantFail(CB.CreateCpp())),
- Interp(cantFail(clang::Interpreter::create(std::move(CI)))) {}
+ void SetUp() override {
+ if (!HostSupportsJIT())
+ GTEST_SKIP();
+ std::unique_ptr<CompilerInstance> CI = cantFail(CB.CreateCpp());
+ this->Interp = cantFail(clang::Interpreter::create(std::move(CI)));
+ }
std::vector<std::string> runComp(llvm::StringRef Input, llvm::Error &ErrR) {
auto ComplCI = CB.CreateCpp();
diff --git a/clang/unittests/Interpreter/IncrementalProcessingTest.cpp b/clang/unittests/Interpreter/IncrementalProcessingTest.cpp
index 1abf5ad..4d7841a 100644
--- a/clang/unittests/Interpreter/IncrementalProcessingTest.cpp
+++ b/clang/unittests/Interpreter/IncrementalProcessingTest.cpp
@@ -19,12 +19,11 @@
#include "clang/Parse/Parser.h"
#include "clang/Sema/Sema.h"
-#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/MemoryBuffer.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/Triple.h"
+
#include "gtest/gtest.h"
#include <memory>
diff --git a/clang/unittests/Interpreter/InterpreterExtensionsTest.cpp b/clang/unittests/Interpreter/InterpreterExtensionsTest.cpp
index 02d4a3c..5f1f29c 100644
--- a/clang/unittests/Interpreter/InterpreterExtensionsTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterExtensionsTest.cpp
@@ -22,8 +22,6 @@
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
#include "llvm/MC/TargetRegistry.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/Threading.h"
#include "llvm/Testing/Support/Error.h"
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp
index 3b07d6d1..ab9b7a3 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -12,21 +12,16 @@
#include "InterpreterTestFixture.h"
-#include "clang/Interpreter/Interpreter.h"
-
#include "clang/AST/Decl.h"
#include "clang/AST/DeclGroup.h"
#include "clang/AST/Mangle.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
+#include "clang/Interpreter/Interpreter.h"
#include "clang/Interpreter/Value.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Sema.h"
-#include "llvm/ExecutionEngine/Orc/LLJIT.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/TargetSelect.h"
-
#include "gmock/gmock.h"
#include "gtest/gtest.h"
diff --git a/clang/unittests/Interpreter/InterpreterTestFixture.h b/clang/unittests/Interpreter/InterpreterTestFixture.h
index caf8141..113599f 100644
--- a/clang/unittests/Interpreter/InterpreterTestFixture.h
+++ b/clang/unittests/Interpreter/InterpreterTestFixture.h
@@ -9,11 +9,9 @@
#ifndef LLVM_CLANG_UNITTESTS_INTERPRETER_INTERPRETERTESTBASE_H
#define LLVM_CLANG_UNITTESTS_INTERPRETER_INTERPRETERTESTBASE_H
-#include "clang/Testing/TestClangConfig.h"
-#include "clang/Tooling/Tooling.h"
-
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/TargetSelect.h"
#include "gtest/gtest.h"
@@ -27,21 +25,21 @@ namespace clang {
class InterpreterTestBase : public ::testing::Test {
protected:
static bool HostSupportsJIT() {
+#ifdef CLANG_INTERPRETER_PLATFORM_CANNOT_CREATE_LLJIT
+ return false;
+#else
if (auto JIT = llvm::orc::LLJITBuilder().create()) {
return true;
} else {
llvm::consumeError(JIT.takeError());
return false;
}
+#endif
}
void SetUp() override {
-#ifdef CLANG_INTERPRETER_PLATFORM_CANNOT_CREATE_LLJIT
- GTEST_SKIP();
-#else
if (!HostSupportsJIT())
GTEST_SKIP();
-#endif
}
void TearDown() override {}