disable use of __builtin_memcmp temporarily to get the tests passing again

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291742 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__string b/include/__string
index 8152660..c85b874 100644
--- a/include/__string
+++ b/include/__string
@@ -209,9 +209,8 @@
     static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
         {return (unsigned char)__c1 < (unsigned char)__c2;}
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
-    int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
-        {return __n == 0 ? 0 : __builtin_memcmp(__s1, __s2, __n);}
+    static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
     static inline size_t _LIBCPP_CONSTEXPR_AFTER_CXX14
     length(const char_type* __s)  _NOEXCEPT {return __builtin_strlen(__s);}
     static _LIBCPP_CONSTEXPR_AFTER_CXX14
@@ -239,6 +238,28 @@
 };
 
 inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+int
+char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+    if (__n == 0)
+        return 0;
+#ifdef _LIBCPP_BUILTIN_MEMCMP_ISCONSTEXPR
+    return __builtin_memcmp(__s1, __s2, __n);
+#elif _LIBCPP_STD_VER <= 14
+    return memcmp(__s1, __s2, __n);
+#else
+    for (; __n; --__n, ++__s1, ++__s2)
+    {
+        if (lt(*__s1, *__s2))
+            return -1;
+        if (lt(*__s2, *__s1))
+            return 1;
+    }
+    return 0;
+#endif
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
 const char*
 char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
 {