Skip to content

Commit

Permalink
Use SKIP_ON_* macros to skip CallTest on unsupported platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
janvrany committed Jun 12, 2021
1 parent 4a8c53c commit 29eff54
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions fvtest/compilertriltest/CallTest.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2019 IBM Corp. and others
* Copyright (c) 2017, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -27,17 +27,23 @@ class CallTest : public TRTest::JitTest {};
int32_t oracleBoracle(int32_t x) { return x + 1123; } // Randomish number to avoid accidental test passes.

TEST_F(CallTest, icallOracle) {

SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390_LINUX(MissingImplementation) << "Test is skipped on S390 Linux because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X_LINUX(MissingImplementation) << "Test is skipped on S390x Linux because calls are not currently supported (see issue #1645)";
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";
SKIP_ON_RISCV(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

char inputTrees[200] = {0};
const auto format_string = "(method return=Int32 args=[Int32] (block (ireturn (icall address=0x%jX args=[Int32] (iload parm=0)) ) ))";
std::snprintf(inputTrees, 200, format_string, reinterpret_cast<uintmax_t>(&oracleBoracle));
auto trees = parseString(inputTrees);

ASSERT_NOTNULL(trees) << "Trees failed to parse\n" << inputTrees;

// Execution of this test is disabled on non-X86 platforms, as we
// do not have trampoline support, and so this call may be out of
// range for some architectures.
#ifdef TR_TARGET_X86
Tril::DefaultCompiler compiler(trees);
ASSERT_EQ(0, compiler.compile()) << "Compilation failed unexpectedly\n" << "Input trees: " << inputTrees;

Expand All @@ -47,5 +53,4 @@ TEST_F(CallTest, icallOracle) {
EXPECT_EQ(oracleBoracle(-128), entry_point(-128));
EXPECT_EQ(oracleBoracle(128), entry_point(128));
EXPECT_EQ(oracleBoracle(1280), entry_point(1280));
#endif
}

0 comments on commit 29eff54

Please sign in to comment.