Skip to content

Commit 80435ba

Browse files
committed
[SystemZ] Set up JIT/MCJIT test cases This patch adds the necessary configuration bits and #ifdef's to set up the JIT/MCJIT test cases for SystemZ. Like other recent targets, we do fully support MCJIT, but do not support the old JIT at all. Set up the lit config files accordingly, and disable old-JIT unit tests. Patch by Richard Sandiford. llvm-svn: 181207
1 parent 982a215 commit 80435ba

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

llvm/test/ExecutionEngine/MCJIT/lit.local.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ root = getRoot(config)
99

1010
targets = set(root.targets_to_build.split())
1111
if ('X86' in targets) | ('AArch64' in targets) | ('ARM' in targets) | \
12-
('Mips' in targets) | ('PowerPC' in targets):
12+
('Mips' in targets) | ('PowerPC' in targets) | ('SystemZ' in targets):
1313
config.unsupported = False
1414
else:
1515
config.unsupported = True
1616

1717
if root.host_arch not in ['i386', 'x86', 'x86_64',
18-
'AArch64', 'ARM', 'Mips', 'PowerPC']:
18+
'AArch64', 'ARM', 'Mips', 'PowerPC', 'SystemZ']:
1919
config.unsupported = True
2020

2121
if 'i386-apple-darwin' in root.target_triple:

llvm/test/ExecutionEngine/lit.local.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def getRoot(config):
77

88
root = getRoot(config)
99

10-
if root.host_arch in ['PowerPC', 'AArch64']:
10+
if root.host_arch in ['PowerPC', 'AArch64', 'SystemZ']:
1111
config.unsupported = True
1212

1313
if 'hexagon' in root.target_triple:

llvm/test/lit.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ config.substitutions.append( ('%lli_mcjit', lli_mcjit) )
160160
# but simply want use the currently considered most reliable jit for platform
161161
# FIXME: ppc32 is not ready for mcjit.
162162
if 'arm' in config.target_triple \
163-
or 'powerpc64' in config.target_triple:
163+
or 'powerpc64' in config.target_triple \
164+
or 's390x' in config.target_triple:
164165
defaultIsMCJIT = 'true'
165166
else:
166167
defaultIsMCJIT = 'false'

llvm/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class JITEventListenerTest : public testing::Test {
7474
const OwningPtr<ExecutionEngine> EE;
7575
};
7676

77+
// Tests on SystemZ disabled as we're running the old JIT
78+
#if !defined(__s390__)
7779
Function *buildFunction(Module *M) {
7880
Function *Result = Function::Create(
7981
TypeBuilder<int32_t(int32_t), false>::get(getGlobalContext()),
@@ -224,6 +226,7 @@ TEST_F(JITEventListenerTest, MatchesMachineCodeInfo) {
224226
EXPECT_EQ(1U, Listener.FreedEvents[0].Index);
225227
EXPECT_EQ(F_addr, Listener.FreedEvents[0].Code);
226228
}
229+
#endif
227230

228231
class JITEnvironment : public testing::Environment {
229232
virtual void SetUp() {

llvm/unittests/ExecutionEngine/JIT/JITTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ using namespace llvm;
3535

3636
namespace {
3737

38-
// Tests on ARM and PowerPC disabled as we're running the old jit
39-
#if !defined(__arm__) && !defined(__powerpc__)
38+
// Tests on ARM, PowerPC and SystemZ disabled as we're running the old jit
39+
#if !defined(__arm__) && !defined(__powerpc__) && !defined(__s390__)
4040

4141
Function *makeReturnGlobal(std::string Name, GlobalVariable *G, Module *M) {
4242
std::vector<Type*> params;
@@ -826,7 +826,7 @@ TEST(LazyLoadedJITTest, EagerCompiledRecursionThroughGhost) {
826826
(intptr_t)TheJIT->getPointerToFunction(recur1IR));
827827
EXPECT_EQ(3, recur1(4));
828828
}
829-
#endif // !defined(__arm__) && !defined(__powerpc__)
829+
#endif // !defined(__arm__) && !defined(__powerpc__) && !defined(__s390__)
830830

831831
// This code is copied from JITEventListenerTest, but it only runs once for all
832832
// the tests in this directory. Everything seems fine, but that's strange

llvm/unittests/ExecutionEngine/JIT/MultiJITTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ using namespace llvm;
2020

2121
namespace {
2222

23-
// ARM and PowerPC tests disabled pending fix for PR10783.
24-
#if !defined(__arm__) && !defined(__powerpc__)
23+
// ARM, PowerPC and SystemZ tests disabled pending fix for PR10783.
24+
#if !defined(__arm__) && !defined(__powerpc__) && !defined(__s390__)
2525

2626
bool LoadAssemblyInto(Module *M, const char *assembly) {
2727
SMDiagnostic Error;
@@ -176,6 +176,6 @@ TEST(MultiJitTest, JitPool) {
176176
#endif
177177
EXPECT_TRUE(sa == fa);
178178
}
179-
#endif // !defined(__arm__) && !defined(__powerpc__)
179+
#endif // !defined(__arm__) && !defined(__powerpc__) && !defined(__s390__)
180180

181181
} // anonymous namespace

0 commit comments

Comments
 (0)