diff options
author | Timm Bäder <tbaeder@redhat.com> | 2025-03-25 07:15:30 +0100 |
---|---|---|
committer | Timm Bäder <tbaeder@redhat.com> | 2025-03-25 07:15:30 +0100 |
commit | 1e2ad6793ac205607e7c809283cf69e1cc36a69a (patch) | |
tree | baddeeadb98d5939f11c9ac9a3647cc09f4645f9 /clang/test/AST/ByteCode/builtin-functions.cpp | |
parent | fac8fe9cf983ef6abee345d18850f1d4b925b519 (diff) | |
download | llvm-1e2ad6793ac205607e7c809283cf69e1cc36a69a.zip llvm-1e2ad6793ac205607e7c809283cf69e1cc36a69a.tar.gz llvm-1e2ad6793ac205607e7c809283cf69e1cc36a69a.tar.bz2 |
Revert "[clang][bytecode] Implement __builtin_{wcscmp,wcsncmp} (#132723)"
This reverts commit f7aea4d081f77dba48b0fc019f59b678fb679aa8.
This broke the clang-solaris11-sparcv9 builder:
https://lab.llvm.org/buildbot/#/builders/13/builds/6151
Diffstat (limited to 'clang/test/AST/ByteCode/builtin-functions.cpp')
-rw-r--r-- | clang/test/AST/ByteCode/builtin-functions.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp index 8408286..8288223 100644 --- a/clang/test/AST/ByteCode/builtin-functions.cpp +++ b/clang/test/AST/ByteCode/builtin-functions.cpp @@ -28,8 +28,6 @@ extern "C" { extern char *strchr(const char *s, int c); extern wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n); extern wchar_t *wcschr(const wchar_t *s, wchar_t c); - extern int wcscmp(const wchar_t *s1, const wchar_t *s2); - extern int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n); } namespace strcmp { @@ -74,50 +72,6 @@ namespace strcmp { static_assert(__builtin_strncmp("abab\0banana", "abab\0canada", 100) == 0); } -namespace WcsCmp { - constexpr wchar_t kFoobar[6] = {L'f',L'o',L'o',L'b',L'a',L'r'}; - constexpr wchar_t kFoobazfoobar[12] = {L'f',L'o',L'o',L'b',L'a',L'z',L'f',L'o',L'o',L'b',L'a',L'r'}; - - static_assert(__builtin_wcscmp(L"abab", L"abab") == 0); - static_assert(__builtin_wcscmp(L"abab", L"abba") == -1); - static_assert(__builtin_wcscmp(L"abab", L"abaa") == 1); - static_assert(__builtin_wcscmp(L"ababa", L"abab") == 1); - static_assert(__builtin_wcscmp(L"abab", L"ababa") == -1); - static_assert(__builtin_wcscmp(L"abab\0banana", L"abab") == 0); - static_assert(__builtin_wcscmp(L"abab", L"abab\0banana") == 0); - static_assert(__builtin_wcscmp(L"abab\0banana", L"abab\0canada") == 0); -#if __WCHAR_WIDTH__ == 32 - static_assert(__builtin_wcscmp(L"a\x83838383", L"a") == (wchar_t)-1U >> 31); -#endif - static_assert(__builtin_wcscmp(0, L"abab") == 0); // both-error {{not an integral constant}} \ - // both-note {{dereferenced null}} - static_assert(__builtin_wcscmp(L"abab", 0) == 0); // both-error {{not an integral constant}} \ - // both-note {{dereferenced null}} - - static_assert(__builtin_wcscmp(kFoobar, kFoobazfoobar) == -1); - static_assert(__builtin_wcscmp(kFoobar, kFoobazfoobar + 6) == 0); // both-error {{not an integral constant}} \ - // both-note {{dereferenced one-past-the-end}} - - static_assert(__builtin_wcsncmp(L"abaa", L"abba", 5) == -1); - static_assert(__builtin_wcsncmp(L"abaa", L"abba", 4) == -1); - static_assert(__builtin_wcsncmp(L"abaa", L"abba", 3) == -1); - static_assert(__builtin_wcsncmp(L"abaa", L"abba", 2) == 0); - static_assert(__builtin_wcsncmp(L"abaa", L"abba", 1) == 0); - static_assert(__builtin_wcsncmp(L"abaa", L"abba", 0) == 0); - static_assert(__builtin_wcsncmp(0, 0, 0) == 0); - static_assert(__builtin_wcsncmp(L"abab\0banana", L"abab\0canada", 100) == 0); -#if __WCHAR_WIDTH__ == 32 - static_assert(__builtin_wcsncmp(L"a\x83838383", L"aa", 2) == - (wchar_t)-1U >> 31); -#endif - - static_assert(__builtin_wcsncmp(kFoobar, kFoobazfoobar, 6) == -1); - static_assert(__builtin_wcsncmp(kFoobar, kFoobazfoobar, 7) == -1); - static_assert(__builtin_wcsncmp(kFoobar, kFoobazfoobar + 6, 6) == 0); - static_assert(__builtin_wcsncmp(kFoobar, kFoobazfoobar + 6, 7) == 0); // both-error {{not an integral constant}} \ - // both-note {{dereferenced one-past-the-end}} -} - /// Copied from constant-expression-cxx11.cpp namespace strlen { constexpr const char *a = "foo\0quux"; |