summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-06-30 00:21:42 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-06-30 00:21:42 +0000
commitcdefdeee288fbfc1a94ac9c9ea19ecad9b4fac53 (patch)
tree6f5c39b9571e2b549cac63930f79bb8f758f5fec /libcxx/test
parent4799d03ce84114290dbbc93d6bc0c8862a901182 (diff)
downloadbcm5719-llvm-cdefdeee288fbfc1a94ac9c9ea19ecad9b4fac53.tar.gz
bcm5719-llvm-cdefdeee288fbfc1a94ac9c9ea19ecad9b4fac53.zip
two steps forward, one step back...
llvm-svn: 107230
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/re/nothing_to_do.pass.cpp3
-rw-r--r--libcxx/test/re/re.alg/nothing_to_do.pass.cpp12
-rw-r--r--libcxx/test/re/re.iter/nothing_to_do.pass.cpp12
-rw-r--r--libcxx/test/re/re.results/types.pass.cpp51
4 files changed, 76 insertions, 2 deletions
diff --git a/libcxx/test/re/nothing_to_do.pass.cpp b/libcxx/test/re/nothing_to_do.pass.cpp
index b85601fc46f..b89f168e9c4 100644
--- a/libcxx/test/re/nothing_to_do.pass.cpp
+++ b/libcxx/test/re/nothing_to_do.pass.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===-------------------------- algorithm ---------------------------------===//
+//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
diff --git a/libcxx/test/re/re.alg/nothing_to_do.pass.cpp b/libcxx/test/re/re.alg/nothing_to_do.pass.cpp
new file mode 100644
index 00000000000..b89f168e9c4
--- /dev/null
+++ b/libcxx/test/re/re.alg/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/libcxx/test/re/re.iter/nothing_to_do.pass.cpp b/libcxx/test/re/re.iter/nothing_to_do.pass.cpp
new file mode 100644
index 00000000000..b89f168e9c4
--- /dev/null
+++ b/libcxx/test/re/re.iter/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/libcxx/test/re/re.results/types.pass.cpp b/libcxx/test/re/re.results/types.pass.cpp
new file mode 100644
index 00000000000..924219fb186
--- /dev/null
+++ b/libcxx/test/re/re.results/types.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class BidirectionalIterator,
+// class Allocator = allocator<sub_match<BidirectionalIterator>>>
+// class match_results
+// {
+// public:
+// typedef sub_match<BidirectionalIterator> value_type;
+// typedef const value_type& const_reference;
+// typedef const_reference reference;
+// typedef /implementation-defined/ const_iterator;
+// typedef const_iterator iterator;
+// typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
+// typedef typename allocator_traits<Allocator>::size_type size_type;
+// typedef Allocator allocator_type;
+// typedef typename iterator_traits<BidirectionalIterator>::value_type char_type;
+// typedef basic_string<char_type> string_type;
+
+#include <regex>
+#include <type_traits>
+
+template <class CharT>
+void
+test()
+{
+ typedef std::match_results<CharT*> MR;
+ static_assert((std::is_same<typename MR::value_type, std::sub_match<CharT*> >::value), "");
+ static_assert((std::is_same<typename MR::const_reference, const std::sub_match<CharT*>& >::value), "");
+ static_assert((std::is_same<typename MR::reference, const std::sub_match<CharT*>& >::value), "");
+ static_assert((!std::is_same<typename MR::const_iterator, void>::value), "");
+ static_assert((std::is_same<typename MR::difference_type, std::ptrdiff_t>::value), "");
+ static_assert((std::is_same<typename MR::size_type, std::size_t>::value), "");
+ static_assert((std::is_same<typename MR::allocator_type, std::allocator<std::sub_match<CharT*> > >::value), "");
+ static_assert((std::is_same<typename MR::char_type, CharT>::value), "");
+ static_assert((std::is_same<typename MR::string_type, std::basic_string<CharT> >::value), "");
+}
+
+int main()
+{
+ test<char>();
+ test<wchar_t>();
+}
OpenPOWER on IntegriCloud