mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-21 12:38:45 +00:00
Add test for PR 8111. By Frits van Bommel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119870 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
078e239f69
commit
a197cba66d
39
unittests/ADT/FoldingSet.cpp
Normal file
39
unittests/ADT/FoldingSet.cpp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
//===- llvm/unittest/ADT/FoldingSetTest.cpp -------------------------------===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// FoldingSet unit tests.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "gtest/gtest.h"
|
||||||
|
#include "llvm/ADT/FoldingSet.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
using namespace llvm;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// Unaligned string test.
|
||||||
|
TEST(FoldingSetTest, UnalignedStringTest) {
|
||||||
|
SCOPED_TRACE("UnalignedStringTest");
|
||||||
|
|
||||||
|
FoldingSetNodeID a, b;
|
||||||
|
// An aligned string
|
||||||
|
std::string str1= "a test string";
|
||||||
|
a.AddString(str1);
|
||||||
|
|
||||||
|
// An unaligned string
|
||||||
|
std::string str2 = ">" + str1;
|
||||||
|
b.AddString(str2.c_str() + 1);
|
||||||
|
|
||||||
|
EXPECT_EQ(a.ComputeHash(), b.ComputeHash());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -43,6 +43,7 @@ add_llvm_unittest(ADT
|
|||||||
ADT/DeltaAlgorithmTest.cpp
|
ADT/DeltaAlgorithmTest.cpp
|
||||||
ADT/DenseMapTest.cpp
|
ADT/DenseMapTest.cpp
|
||||||
ADT/DenseSetTest.cpp
|
ADT/DenseSetTest.cpp
|
||||||
|
ADT/FoldingSet.cpp
|
||||||
ADT/ilistTest.cpp
|
ADT/ilistTest.cpp
|
||||||
ADT/ImmutableSetTest.cpp
|
ADT/ImmutableSetTest.cpp
|
||||||
ADT/IntervalMapTest.cpp
|
ADT/IntervalMapTest.cpp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user