aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Interpreter/CodeCompletionTest.cpp
diff options
context:
space:
mode:
authorStefan Gränitz <stefan.graenitz@gmail.com>2024-05-30 15:17:27 +0200
committerStefan Gränitz <stefan.graenitz@gmail.com>2024-05-30 17:03:21 +0200
commit647d2728c4dbc387521ce3984ebfda78ff2b031f (patch)
treedcda4be7243b0c67dbd4552bc3fd3832a134e9f7 /clang/unittests/Interpreter/CodeCompletionTest.cpp
parente8de977716e45f815edf98b0c7f53b87a1558e73 (diff)
downloadllvm-647d2728c4dbc387521ce3984ebfda78ff2b031f.zip
llvm-647d2728c4dbc387521ce3984ebfda78ff2b031f.tar.gz
llvm-647d2728c4dbc387521ce3984ebfda78ff2b031f.tar.bz2
[clang-repl] Fix SetUp in CodeCompletionTest fixture (#93816)
And sort out some unused headers
Diffstat (limited to 'clang/unittests/Interpreter/CodeCompletionTest.cpp')
-rw-r--r--clang/unittests/Interpreter/CodeCompletionTest.cpp16
1 files changed, 6 insertions, 10 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();