llvm-project/llvm/unittests/ADT
Pavel Labath 47e9a21d34 [ADT] Add streaming operators for llvm::Optional
Summary:
The operators simply print the underlying value or "None".

The trickier part of this patch is making sure the streaming operators
work even in unit tests (which was my primary motivation, though I can
also see them being useful elsewhere). Since the stream operator was a
template, implicit conversions did not kick in, and our gtest glue code
was explicitly introducing an implicit conversion to make sure other
implicit conversions do not kick in :P. I resolve that by specializing
llvm_gtest::StreamSwitch for llvm:Optional<T>.

Reviewers: sammccall, dblaikie

Reviewed By: sammccall

Subscribers: mgorny, dexonsmith, kristina, llvm-commits

Differential Revision: https://reviews.llvm.org/D56795

llvm-svn: 351548
2019-01-18 12:52:03 +00:00
..
APFloatTest.cpp APFloat: allow 64-bit of payload 2018-12-10 19:27:38 +00:00
APIntTest.cpp [APInt] Add methods for saturated add and sub 2018-11-20 16:47:59 +00:00
APSIntTest.cpp
AnyTest.cpp [ADT] Only run death tests in !NDEBUG 2018-07-20 22:15:09 +00:00
ArrayRefTest.cpp Revert "ADT: Move ArrayRef comparison operators into the class" 2018-06-28 12:10:21 +00:00
BitVectorTest.cpp [ADT] Fix bugs in SmallBitVector. 2018-12-14 18:21:20 +00:00
BitmaskEnumTest.cpp
BreadthFirstIteratorTest.cpp
BumpPtrListTest.cpp
CMakeLists.txt [ADT] Implemented unittests for ImmutableList 2018-08-13 17:32:48 +00:00
DAGDeltaAlgorithmTest.cpp
DeltaAlgorithmTest.cpp
DenseMapTest.cpp [ADT] Adds equality operators for DenseMap and DenseSet, and an initializer_list 2018-10-15 15:26:47 +00:00
DenseSetTest.cpp [ADT] Fix a bug in DenseSet's initializer_list constructor. 2018-10-15 18:34:36 +00:00
DepthFirstIteratorTest.cpp
EquivalenceClassesTest.cpp
FoldingSet.cpp
FunctionExtrasTest.cpp [ADT] Add llvm::unique_function which is like std::function but 2018-07-02 23:57:29 +00:00
FunctionRefTest.cpp
HashingTest.cpp Tests: fix tests encoding specific hash values for 32-bit systems. 2018-08-31 19:24:37 +00:00
IListBaseTest.cpp
IListIteratorTest.cpp
IListNodeBaseTest.cpp
IListNodeTest.cpp
IListSentinelTest.cpp
IListTest.cpp
ImmutableListTest.cpp [ADT] Made numerous methods of ImmutableList const 2018-09-12 11:20:15 +00:00
ImmutableMapTest.cpp
ImmutableSetTest.cpp
IntEqClassesTest.cpp
IntervalMapTest.cpp [ADT] IntervalMap: add overlaps(a, b) method 2018-12-21 13:04:34 +00:00
IntrusiveRefCntPtrTest.cpp
IteratorTest.cpp [ADT] Add zip_longest iterators. 2018-12-05 00:31:54 +00:00
MakeUniqueTest.cpp
MapVectorTest.cpp [ADT] Fix MapVector when 'Map::mapped_type != unsigned'. 2018-04-08 08:48:58 +00:00
MappedIteratorTest.cpp
OptionalTest.cpp [ADT] Add streaming operators for llvm::Optional 2019-01-18 12:52:03 +00:00
PackedVectorTest.cpp
PointerEmbeddedIntTest.cpp
PointerIntPairTest.cpp
PointerSumTypeTest.cpp
PointerUnionTest.cpp
PostOrderIteratorTest.cpp
PriorityWorklistTest.cpp
RangeAdapterTest.cpp
SCCIteratorTest.cpp
STLExtrasTest.cpp 2nd attempt to fix ambiguities because of ADL 2018-10-31 01:58:00 +00:00
ScopeExitTest.cpp Give scope_exit helper correct move semantics 2018-01-25 16:55:48 +00:00
SequenceTest.cpp
SetVectorTest.cpp
SimpleIListTest.cpp
SmallPtrSetTest.cpp [unittests] ADT: silence -Wself-assign diagnostics 2018-04-07 10:37:18 +00:00
SmallSetTest.cpp [ADT] Remove illegal comparison of singular iterators from SmallSetTest 2018-10-31 11:00:48 +00:00
SmallStringTest.cpp
SmallVectorTest.cpp
SparseBitVectorTest.cpp [ADT] Clean up SparseBitVector copying and make it moveable 2018-11-01 13:55:59 +00:00
SparseMultiSetTest.cpp
SparseSetTest.cpp
StatisticTest.cpp Fix unused function warning in StatisticTest.cpp 2018-03-08 15:52:45 +00:00
StringExtrasTest.cpp [ADT] Support converting to lowercase string in toHex 2018-09-10 19:34:44 +00:00
StringMapTest.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
StringRefTest.cpp [ADT] Add `StringRef::rsplit(StringRef Separator)`. 2018-06-08 12:42:12 +00:00
StringSwitchTest.cpp [ADT] Simplify and optimize StringSwitch 2018-02-26 18:41:26 +00:00
TestGraph.h Add header guards to some headers that are missing them 2018-09-03 16:22:05 +00:00
TinyPtrVectorTest.cpp
TripleTest.cpp [WebAssembly] COWS has been renamed to WASI. 2019-01-16 05:23:52 +00:00
TwineTest.cpp
VariadicFunctionTest.cpp