diff options
Diffstat (limited to 'llvm/unittests')
-rw-r--r-- | llvm/unittests/IR/ConstantRangeTest.cpp | 1 | ||||
-rw-r--r-- | llvm/unittests/Support/TypeTraitsTest.cpp | 21 | ||||
-rw-r--r-- | llvm/unittests/Transforms/Scalar/CMakeLists.txt | 5 | ||||
-rw-r--r-- | llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp | 10 |
4 files changed, 27 insertions, 10 deletions
diff --git a/llvm/unittests/IR/ConstantRangeTest.cpp b/llvm/unittests/IR/ConstantRangeTest.cpp index a1c66f33abb..b6a794f0918 100644 --- a/llvm/unittests/IR/ConstantRangeTest.cpp +++ b/llvm/unittests/IR/ConstantRangeTest.cpp @@ -459,6 +459,7 @@ void testBinarySetOperationExhaustive(Fn1 OpFn, Fn2 InResultFn) { } } + (void)HaveInterrupt3; assert(!HaveInterrupt3 && "Should have at most three ranges"); ConstantRange SmallestCR = OpFn(CR1, CR2, ConstantRange::Smallest); diff --git a/llvm/unittests/Support/TypeTraitsTest.cpp b/llvm/unittests/Support/TypeTraitsTest.cpp index d33dee97eca..e7a102543e6 100644 --- a/llvm/unittests/Support/TypeTraitsTest.cpp +++ b/llvm/unittests/Support/TypeTraitsTest.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/type_traits.h" +#include "gtest/gtest.h" namespace { @@ -71,6 +72,26 @@ template void TrivialityTester<Z &&, false, true>(); template void TrivialityTester<A &&, false, true>(); template void TrivialityTester<B &&, false, true>(); +TEST(Triviality, Tester) { + TrivialityTester<int, true, true>(); + TrivialityTester<void *, true, true>(); + TrivialityTester<int &, true, true>(); + TrivialityTester<int &&, false, true>(); + + TrivialityTester<X, true, true>(); + TrivialityTester<Y, false, false>(); + TrivialityTester<Z, false, false>(); + TrivialityTester<A, true, false>(); + TrivialityTester<B, false, true>(); + + TrivialityTester<Z &, true, true>(); + TrivialityTester<A &, true, true>(); + TrivialityTester<B &, true, true>(); + TrivialityTester<Z &&, false, true>(); + TrivialityTester<A &&, false, true>(); + TrivialityTester<B &&, false, true>(); +} + } // namespace triviality } // end anonymous namespace diff --git a/llvm/unittests/Transforms/Scalar/CMakeLists.txt b/llvm/unittests/Transforms/Scalar/CMakeLists.txt index 2762799d612..3d01d5c5334 100644 --- a/llvm/unittests/Transforms/Scalar/CMakeLists.txt +++ b/llvm/unittests/Transforms/Scalar/CMakeLists.txt @@ -10,3 +10,8 @@ set(LLVM_LINK_COMPONENTS add_llvm_unittest(ScalarTests LoopPassManagerTest.cpp ) + +# Workaround for the gcc 6.1 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80916. +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES COMPILE_FLAGS -Wno-unused-function) +endif() diff --git a/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp b/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp index fc94b6e8c1a..0743cba852d 100644 --- a/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp +++ b/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp @@ -20,19 +20,9 @@ #include "llvm/IR/PassManager.h" #include "llvm/Support/SourceMgr.h" -// Workaround for the gcc 6.1 bug PR80916. -#if defined(__GNUC__) && __GNUC__ > 5 -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-function" -#endif - #include "gmock/gmock.h" #include "gtest/gtest.h" -#if defined(__GNUC__) && __GNUC__ > 5 -# pragma GCC diagnostic pop -#endif - using namespace llvm; namespace { |