Skip to content

Commit 24192ce

Browse files
author
kr-2003
committed
testing
1 parent 6610cf0 commit 24192ce

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

clang/unittests/Interpreter/InterpreterTest.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515
#include "clang/AST/Decl.h"
1616
#include "clang/AST/DeclGroup.h"
1717
#include "clang/AST/Mangle.h"
18+
#include "clang/Basic/Version.h"
19+
#include "clang/Config/config.h"
1820
#include "clang/Frontend/CompilerInstance.h"
1921
#include "clang/Frontend/TextDiagnosticPrinter.h"
2022
#include "clang/Interpreter/Interpreter.h"
2123
#include "clang/Interpreter/RemoteJITUtils.h"
2224
#include "clang/Interpreter/Value.h"
2325
#include "clang/Sema/Lookup.h"
2426
#include "clang/Sema/Sema.h"
25-
#include "llvm/TargetParser/Host.h"
2627
#include "llvm/Support/Error.h"
28+
#include "llvm/TargetParser/Host.h"
2729

2830
#include "gmock/gmock.h"
2931
#include "gtest/gtest.h"
@@ -82,18 +84,15 @@ static std::string getOrcRuntimePath() {
8284
llvm::sys::path::remove_filename(RuntimePath); // Remove "clang"
8385
llvm::sys::path::remove_filename(RuntimePath); // Remove "tools"
8486

85-
llvm::sys::path::append(RuntimePath, "lib", "clang", "20", "lib");
87+
llvm::sys::path::append(RuntimePath, CLANG_INSTALL_LIBDIR_BASENAME, "clang",
88+
CLANG_VERSION_MAJOR_STRING, "lib");
8689

87-
// Add platform-specific runtime library
8890
llvm::Triple SystemTriple(llvm::sys::getProcessTriple());
89-
if (SystemTriple.isOSDarwin()) {
91+
if (SystemTriple.isOSBinFormatMachO()) {
9092
llvm::sys::path::append(RuntimePath, "darwin", "liborc_rt_osx.a");
91-
} else if (SystemTriple.isOSLinux()) {
93+
} else if (SystemTriple.isOSBinFormatELF()) {
9294
llvm::sys::path::append(RuntimePath, "x86_64-unknown-linux-gnu",
9395
"liborc_rt.a");
94-
} else {
95-
// Add other platforms as needed
96-
llvm::sys::path::append(RuntimePath, "liborc_rt.a");
9796
}
9897

9998
return RuntimePath.str().str();
@@ -118,15 +117,14 @@ createInterpreterWithRemoteExecution(const Args &ExtraArgs = {},
118117

119118
if ((SystemTriple.isOSBinFormatELF() || SystemTriple.isOSBinFormatMachO())) {
120119
std::string OOPExecutor = getExecutorPath();
121-
std::cout << "Executor Path: " << OOPExecutor << "\n";
122120
if (!llvm::sys::fs::exists(OOPExecutor)) {
123121
std::cout << "Executor path does not exist: " << OOPExecutor << std::endl;
124122
return nullptr;
125123
}
126124

127125
std::string OrcRuntimePath = getOrcRuntimePath();
128126

129-
if(!llvm::sys::fs::exists(OrcRuntimePath)) {
127+
if (!llvm::sys::fs::exists(OrcRuntimePath)) {
130128
std::cout << "ORC runtime path does not exist: " << OrcRuntimePath
131129
<< std::endl;
132130
}
@@ -151,10 +149,6 @@ createInterpreterWithRemoteExecution(const Args &ExtraArgs = {},
151149
setvbuf(stdout, nullptr, _IONBF, 0);
152150
setvbuf(stderr, nullptr, _IONBF, 0);
153151
}));
154-
OrcRuntimePath = getOrcRuntimePath();
155-
156-
std::cout << "Orc Runtime Path: " << OrcRuntimePath << "\n";
157-
158152
if (EPC) {
159153
CB.SetTargetTriple(EPC->getTargetTriple().getTriple());
160154
JB = ExitOnError(clang::Interpreter::createLLJITBuilder(std::move(EPC),

0 commit comments

Comments
 (0)