Add an empty key for DebugLoc so that you can store an empty DebugLoc in a
[llvm/stm8.git] / unittests / ADT / DenseSetTest.cpp
blob7a35f521a196448b45f7d09612b84e646f9a366c
1 //===- llvm/unittest/ADT/DenseSetTest.cpp - DenseSet unit tests --*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #include "gtest/gtest.h"
11 #include <llvm/ADT/DenseSet.h>
13 using namespace llvm;
15 namespace {
17 // Test fixture
18 class DenseSetTest : public testing::Test {
21 // Test hashing with a set of only two entries.
22 TEST_F(DenseSetTest, DoubleEntrySetTest) {
23 llvm::DenseSet<unsigned> set(2);
24 set.insert(0);
25 set.insert(1);
26 // Original failure was an infinite loop in this call:
27 EXPECT_EQ(0, set.count(2));