llvm.org GIT mirror llvm / 059c038
Fix compilation warnings when compiling with GCC 7.3 Differential Revision: https://reviews.llvm.org/D61046 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360044 91177308-0d34-0410-b5e6-96231b3b80d8 Alexandre Ganea 5 months ago
5 changed file(s) with 33 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
17121712 }
17131713
17141714 if (NewBldVec[i].isUndef())
1715 continue;
1716 // Fix spurious warning with gcc 7.3 -O3
1717 // warning: array subscript is above array bounds [-Warray-bounds]
1718 // if (NewBldVec[i] == NewBldVec[j]) {
1719 // ~~~~~~~~~~~^
1720 if (i >= 4)
17151721 continue;
17161722 for (unsigned j = 0; j < i; j++) {
17171723 if (NewBldVec[i] == NewBldVec[j]) {
458458 }
459459 }
460460
461 (void)HaveInterrupt3;
461462 assert(!HaveInterrupt3 && "Should have at most three ranges");
462463
463464 ConstantRange SmallestCR = OpFn(CR1, CR2, ConstantRange::Smallest);
66 //===----------------------------------------------------------------------===//
77
88 #include "llvm/Support/type_traits.h"
9 #include "gtest/gtest.h"
910
1011 namespace {
1112
7071 template void TrivialityTester();
7172 template void TrivialityTester();
7273
74 TEST(Triviality, Tester) {
75 TrivialityTester();
76 TrivialityTester();
77 TrivialityTester();
78 TrivialityTester();
79
80 TrivialityTester();
81 TrivialityTester();
82 TrivialityTester();
83 TrivialityTester();
84 TrivialityTester();
85
86 TrivialityTester();
87 TrivialityTester();
88 TrivialityTester();
89 TrivialityTester();
90 TrivialityTester();
91 TrivialityTester();
92 }
93
7394 } // namespace triviality
7495
7596 } // end anonymous namespace
99 add_llvm_unittest(ScalarTests
1010 LoopPassManagerTest.cpp
1111 )
12
13 # Workaround for the gcc 6.1 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80916.
14 if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
15 set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES COMPILE_FLAGS -Wno-unused-function)
16 endif()
1919 #include "llvm/IR/PassManager.h"
2020 #include "llvm/Support/SourceMgr.h"
2121
22 // Workaround for the gcc 6.1 bug PR80916.
23 #if defined(__GNUC__) && __GNUC__ > 5
24 # pragma GCC diagnostic push
25 # pragma GCC diagnostic ignored "-Wunused-function"
26 #endif
27
2822 #include "gmock/gmock.h"
2923 #include "gtest/gtest.h"
30
31 #if defined(__GNUC__) && __GNUC__ > 5
32 # pragma GCC diagnostic pop
33 #endif
3424
3525 using namespace llvm;
3626