From d242e37d84572aa1fddc9017c205cafa99e3f2e8 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 23 Aug 2014 22:35:08 -0700 Subject: [PATCH] Running (IVM) tests on osx. --- tools/alloy-test/test_add.cc | 2 ++ tools/alloy-test/test_vector_add.cc | 4 +++- tools/alloy-test/util.h | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/alloy-test/test_add.cc b/tools/alloy-test/test_add.cc index 6805cbfc6..3a6f6146a 100644 --- a/tools/alloy-test/test_add.cc +++ b/tools/alloy-test/test_add.cc @@ -9,6 +9,8 @@ #include +#include + using namespace alloy; using namespace alloy::hir; using namespace alloy::runtime; diff --git a/tools/alloy-test/test_vector_add.cc b/tools/alloy-test/test_vector_add.cc index 08a60715d..ed236743a 100644 --- a/tools/alloy-test/test_vector_add.cc +++ b/tools/alloy-test/test_vector_add.cc @@ -9,6 +9,8 @@ #include +#include + using namespace alloy; using namespace alloy::hir; using namespace alloy::runtime; @@ -262,7 +264,7 @@ TEST_CASE("VECTOR_ADD_F32", "[instr]") { REQUIRE(result == vec128i(0x7F800000)); }); test.Run([](PPCContext* ctx) { - ctx->v[4] = vec128f(FLT_MIN); + ctx->v[4] = vec128f(-FLT_MIN); ctx->v[5] = vec128f(-1.0f); }, [](PPCContext* ctx) { diff --git a/tools/alloy-test/util.h b/tools/alloy-test/util.h index 175140f37..e6673dfe5 100644 --- a/tools/alloy-test/util.h +++ b/tools/alloy-test/util.h @@ -22,6 +22,9 @@ #include +#define ALLOY_TEST_IVM 1 +//#define ALLOY_TEST_X64 1 + namespace alloy { namespace test { @@ -82,6 +85,7 @@ class TestFunction { memory_size = 16 * 1024 * 1024; memory.reset(new SimpleMemory(memory_size)); +#if ALLOY_TEST_IVM { auto runtime = std::make_unique(memory.get()); auto frontend = @@ -91,6 +95,8 @@ class TestFunction { runtime->Initialize(std::move(frontend), std::move(backend)); runtimes.emplace_back(std::move(runtime)); } +#endif // ALLOY_TEST_IVM +#ifdef ALLOY_TEST_X64 { auto runtime = std::make_unique(memory.get()); auto frontend = @@ -100,6 +106,7 @@ class TestFunction { runtime->Initialize(std::move(frontend), std::move(backend)); runtimes.emplace_back(std::move(runtime)); } +#endif // ALLOY_TEST_X64 for (auto& runtime : runtimes) { auto module = std::make_unique(