diff --git a/src/llvm_state.cpp b/src/llvm_state.cpp index 5f3c4820c..095469349 100644 --- a/src/llvm_state.cpp +++ b/src/llvm_state.cpp @@ -1815,6 +1815,12 @@ llvm_multi_state::llvm_multi_state(std::vector states) // Settings in all states must be consistent. auto states_differ = [](const llvm_state &s1, const llvm_state &s2) { + // NOTE: bit of paranoia here. + assert(s1.m_jitter->m_lljit->getDataLayout() == s2.m_jitter->m_lljit->getDataLayout()); + assert(s1.m_jitter->get_target_triple() == s2.m_jitter->get_target_triple()); + assert(s1.m_jitter->get_target_cpu() == s2.m_jitter->get_target_cpu()); + assert(s1.m_jitter->get_target_features() == s2.m_jitter->get_target_features()); + if (s1.get_opt_level() != s2.get_opt_level()) { return true; } diff --git a/test/llvm_multi_state.cpp b/test/llvm_multi_state.cpp index 5d2ea026c..f35035672 100644 --- a/test/llvm_multi_state.cpp +++ b/test/llvm_multi_state.cpp @@ -324,12 +324,12 @@ TEST_CASE("cfunc") || s2.get_ir().substr(0, 100) == ms.get_ir()[1].substr(0, 100) || s2.get_ir().substr(0, 100) == ms.get_ir()[2].substr(0, 100))); - REQUIRE((s1.get_bc().substr(0, 50) == ms.get_bc()[0].substr(0, 50) - || s1.get_bc().substr(0, 50) == ms.get_bc()[1].substr(0, 50) - || s1.get_bc().substr(0, 50) == ms.get_bc()[2].substr(0, 50))); - REQUIRE((s2.get_bc().substr(0, 50) == ms.get_bc()[0].substr(0, 50) - || s2.get_bc().substr(0, 50) == ms.get_bc()[1].substr(0, 50) - || s2.get_bc().substr(0, 50) == ms.get_bc()[2].substr(0, 50))); + REQUIRE((s1.get_bc().substr(0, 25) == ms.get_bc()[0].substr(0, 25) + || s1.get_bc().substr(0, 25) == ms.get_bc()[1].substr(0, 25) + || s1.get_bc().substr(0, 25) == ms.get_bc()[2].substr(0, 25))); + REQUIRE((s2.get_bc().substr(0, 25) == ms.get_bc()[0].substr(0, 25) + || s2.get_bc().substr(0, 25) == ms.get_bc()[1].substr(0, 25) + || s2.get_bc().substr(0, 25) == ms.get_bc()[2].substr(0, 25))); auto *cf1_ptr = reinterpret_cast(ms.jit_lookup("f1"));