Implement n3607: 'equal', 'mismatch', and 'is_permutation'

llvm-svn: 181548
diff --git a/libcxx/test/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp b/libcxx/test/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
index 9dfebac..fe67854 100644
--- a/libcxx/test/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
+++ b/libcxx/test/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
@@ -19,6 +19,10 @@
 
 #include "test_iterators.h"
 
+#if _LIBCPP_STD_VER > 11
+#define HAS_FOUR_ITERATOR_VERSION
+#endif
+
 int main()
 {
     int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
@@ -31,4 +35,24 @@
                                     input_iterator<const int*> >(
                             input_iterator<const int*>(ia+3),
                             input_iterator<const int*>(ib+3))));
+
+#ifdef HAS_FOUR_ITERATOR_VERSION
+    assert(std::mismatch(input_iterator<const int*>(ia),
+                         input_iterator<const int*>(ia + sa),
+                         input_iterator<const int*>(ib),
+                         input_iterator<const int*>(ib + sa)) ==
+                         (std::pair<input_iterator<const int*>,
+                                    input_iterator<const int*> >(
+                            input_iterator<const int*>(ia+3),
+                            input_iterator<const int*>(ib+3))));
+
+    assert(std::mismatch(input_iterator<const int*>(ia),
+                         input_iterator<const int*>(ia + sa),
+                         input_iterator<const int*>(ib),
+                         input_iterator<const int*>(ib + 2)) ==
+                         (std::pair<input_iterator<const int*>,
+                                    input_iterator<const int*> >(
+                            input_iterator<const int*>(ia+2),
+                            input_iterator<const int*>(ib+2))));
+#endif
 }