2009-05-01 22:47:53 +02:00
|
|
|
//===- llvm/unittest/ADT/DenseSetTest.cpp - DenseSet unit tests --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "gtest/gtest.h"
|
2012-09-15 20:45:38 +02:00
|
|
|
#include "llvm/ADT/DenseSet.h"
|
2009-05-01 22:47:53 +02:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// Test fixture
|
|
|
|
class DenseSetTest : public testing::Test {
|
|
|
|
};
|
|
|
|
|
|
|
|
// Test hashing with a set of only two entries.
|
|
|
|
TEST_F(DenseSetTest, DoubleEntrySetTest) {
|
|
|
|
llvm::DenseSet<unsigned> set(2);
|
|
|
|
set.insert(0);
|
|
|
|
set.insert(1);
|
|
|
|
// Original failure was an infinite loop in this call:
|
2014-06-20 21:54:13 +02:00
|
|
|
EXPECT_EQ(0u, set.count(2));
|
2009-05-01 22:47:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|