if (NewBldVec[i].isUndef())
continue;
+ // Fix spurious warning with gcc 7.3 -O3
+ // warning: array subscript is above array bounds [-Warray-bounds]
+ // if (NewBldVec[i] == NewBldVec[j]) {
+ // ~~~~~~~~~~~^
+ if (i >= 4)
+ continue;
for (unsigned j = 0; j < i; j++) {
if (NewBldVec[i] == NewBldVec[j]) {
NewBldVec[i] = DAG.getUNDEF(NewBldVec[i].getValueType());
//===----------------------------------------------------------------------===//
#include "llvm/Support/type_traits.h"
+#include "gtest/gtest.h"
namespace {
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
#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 {