diff options
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/APFloatTest.cpp | 23 | ||||
-rw-r--r-- | unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp | 2 | ||||
-rw-r--r-- | unittests/ExecutionEngine/MCJIT/MCJITTestBase.h | 4 | ||||
-rw-r--r-- | unittests/Support/ManagedStatic.cpp | 3 |
4 files changed, 28 insertions, 4 deletions
diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp index 278983565c..099f6db7cb 100644 --- a/unittests/ADT/APFloatTest.cpp +++ b/unittests/ADT/APFloatTest.cpp @@ -33,6 +33,29 @@ static std::string convertToString(double d, unsigned Prec, unsigned Pad) { namespace { +TEST(APFloatTest, FMA) { + APFloat::roundingMode rdmd = APFloat::rmNearestTiesToEven; + + { + APFloat f1(14.5f); + APFloat f2(-14.5f); + APFloat f3(225.0f); + f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven); + EXPECT_EQ(14.75f, f1.convertToFloat()); + } + + { + APFloat Val2(2.0f); + APFloat f1((float)1.17549435e-38F); + APFloat f2((float)1.17549435e-38F); + f1.divide(Val2, rdmd); + f2.divide(Val2, rdmd); + APFloat f3(12.0f); + f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven); + EXPECT_EQ(12.0f, f1.convertToFloat()); + } +} + TEST(APFloatTest, Denormal) { APFloat::roundingMode rdmd = APFloat::rmNearestTiesToEven; diff --git a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp index 0061e30e7a..abe8be450a 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp @@ -98,7 +98,7 @@ protected: void compileAndRun(int ExpectedRC = OriginalRC) { // This function shouldn't be called until after SetUp. - ASSERT_TRUE(0 != TheJIT); + ASSERT_TRUE(TheJIT.isValid()); ASSERT_TRUE(0 != Main); TheJIT->finalizeObject(); diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h index b0e98a88de..e99aa99160 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h +++ b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h @@ -165,7 +165,7 @@ protected: std::string Error; TheJIT.reset(EB.setEngineKind(EngineKind::JIT) .setUseMCJIT(true) /* can this be folded into the EngineKind enum? */ - .setJITMemoryManager(MM) + .setMCJITMemoryManager(MM) .setErrorStr(&Error) .setOptLevel(CodeGenOpt::None) .setAllocateGVsWithCode(false) /*does this do anything?*/ @@ -188,7 +188,7 @@ protected: OwningPtr<TargetMachine> TM; OwningPtr<ExecutionEngine> TheJIT; IRBuilder<> Builder; - JITMemoryManager *MM; + RTDyldMemoryManager *MM; OwningPtr<Module> M; }; diff --git a/unittests/Support/ManagedStatic.cpp b/unittests/Support/ManagedStatic.cpp index 8ddad38ecf..1497f4e340 100644 --- a/unittests/Support/ManagedStatic.cpp +++ b/unittests/Support/ManagedStatic.cpp @@ -19,7 +19,8 @@ using namespace llvm; namespace { -#if defined(HAVE_PTHREAD_H) && !__has_feature(memory_sanitizer) +#if LLVM_ENABLE_THREADS != 0 && defined(HAVE_PTHREAD_H) && \ + !__has_feature(memory_sanitizer) namespace test1 { llvm::ManagedStatic<int> ms; void *helper(void*) { |