summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-02-12 19:47:35 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-02-12 19:47:35 +0000
commit67d55fac127e40a90d3700f8291ce5dee26fad36 (patch)
tree59fc49651ae5abd45325cc1828d8954d0eae4ace /llvm/unittests/ADT
parent92734d1b2bd2322dbccb64ccd6448c6473f6f7e6 (diff)
downloadbcm5719-llvm-67d55fac127e40a90d3700f8291ce5dee26fad36.tar.gz
bcm5719-llvm-67d55fac127e40a90d3700f8291ce5dee26fad36.zip
[ADT] Revert the llvm/ADT/OptionSet.h header and unit test.
llvm-svn: 260714
Diffstat (limited to 'llvm/unittests/ADT')
-rw-r--r--llvm/unittests/ADT/CMakeLists.txt1
-rw-r--r--llvm/unittests/ADT/OptionSetTest.cpp115
2 files changed, 0 insertions, 116 deletions
diff --git a/llvm/unittests/ADT/CMakeLists.txt b/llvm/unittests/ADT/CMakeLists.txt
index 38a3d71196e..bce1bf93a33 100644
--- a/llvm/unittests/ADT/CMakeLists.txt
+++ b/llvm/unittests/ADT/CMakeLists.txt
@@ -24,7 +24,6 @@ set(ADTSources
MakeUniqueTest.cpp
MapVectorTest.cpp
OptionalTest.cpp
- OptionSetTest.cpp
PackedVectorTest.cpp
PointerEmbeddedIntTest.cpp
PointerIntPairTest.cpp
diff --git a/llvm/unittests/ADT/OptionSetTest.cpp b/llvm/unittests/ADT/OptionSetTest.cpp
deleted file mode 100644
index 21411fe09e0..00000000000
--- a/llvm/unittests/ADT/OptionSetTest.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-//===- llvm/unittests/ADT/OptionSetTest.cpp -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/OptionSet.h"
-#include "gtest/gtest.h"
-
-using namespace llvm;
-
-TEST(OptionSet, contains) {
- enum class Flags {
- A = 1 << 0,
- B = 1 << 1,
- C = 1 << 2
- };
-
- OptionSet<Flags> emptySet;
- OptionSet<Flags> aSet = Flags::A;
- OptionSet<Flags> abSet = aSet | Flags::B;
- OptionSet<Flags> abcSet = abSet | Flags::C;
- OptionSet<Flags> bcSet = abcSet - Flags::A;
- OptionSet<Flags> cSet = bcSet - Flags::B;
-
- EXPECT_TRUE(emptySet.contains(emptySet));
- EXPECT_FALSE(emptySet.contains(aSet));
- EXPECT_FALSE(emptySet.contains(abSet));
- EXPECT_FALSE(emptySet.contains(abcSet));
- EXPECT_FALSE(emptySet.contains(bcSet));
- EXPECT_FALSE(emptySet.contains(cSet));
-
- EXPECT_TRUE(aSet.contains(emptySet));
- EXPECT_TRUE(aSet.contains(aSet));
- EXPECT_FALSE(aSet.contains(abSet));
- EXPECT_FALSE(aSet.contains(abcSet));
- EXPECT_FALSE(aSet.contains(bcSet));
- EXPECT_FALSE(aSet.contains(cSet));
-
- EXPECT_TRUE(abSet.contains(emptySet));
- EXPECT_TRUE(abSet.contains(aSet));
- EXPECT_TRUE(abSet.contains(abSet));
- EXPECT_FALSE(abSet.contains(abcSet));
- EXPECT_FALSE(abSet.contains(bcSet));
- EXPECT_FALSE(abSet.contains(cSet));
-
- EXPECT_TRUE(abcSet.contains(emptySet));
- EXPECT_TRUE(abcSet.contains(aSet));
- EXPECT_TRUE(abcSet.contains(abSet));
- EXPECT_TRUE(abcSet.contains(abcSet));
- EXPECT_TRUE(abcSet.contains(bcSet));
- EXPECT_TRUE(abcSet.contains(cSet));
-}
-
-
-TEST(OptionSet, intptr_t) {
- enum class Small : int8_t {
- A = 1 << 0
- };
-
- OptionSet<Small> small = Small::A;
- EXPECT_EQ(static_cast<intptr_t>(Small::A), static_cast<intptr_t>(small));
-
-
-#ifndef _MSC_VER
- // Fails to compile in MSVC.
- enum class UPtr : uintptr_t {
- A = std::numeric_limits<uintptr_t>::max()
- };
-
- OptionSet<UPtr> uptr = UPtr::A;
- EXPECT_EQ(static_cast<intptr_t>(UPtr::A), static_cast<intptr_t>(uptr));
-
-
- enum class Ptr : intptr_t {
- A = std::numeric_limits<intptr_t>::min()
- };
-
- OptionSet<Ptr> ptr = Ptr::A;
- EXPECT_EQ(static_cast<intptr_t>(Ptr::A), static_cast<intptr_t>(ptr));
-#endif
-}
-
-#ifndef _MSC_VER
-// FIXME: This fails on MSVC.
-TEST(OptionSet, intptr_t_isConstructible) {
- // First check that std::is_constructible counts explicit conversion
- // operators.
- class AlwaysConvertible {
- public:
- explicit operator intptr_t () const { return 0; }
- };
-
- if (!std::is_constructible<intptr_t, AlwaysConvertible>::value) {
- // std::is_constructible doesn't test what we want it to. Just exit early.
- return;
- }
-
- enum class LongLong : unsigned long long {
- A = 1
- };
- bool isConvertible =
- std::is_constructible<intptr_t, OptionSet<LongLong>>::value;
-
- if (sizeof(intptr_t) < sizeof(long long)) {
- EXPECT_FALSE(isConvertible);
- } else {
- EXPECT_TRUE(isConvertible);
- }
-}
-#endif
-
OpenPOWER on IntegriCloud