Skip to content

Commit 8f53a67

Browse files
authored
[libc++][Android] Allow testing libc++ with clang-r536225 (#116149)
The Android clang-r536225 compiler identifies as Clang 19, but it is based on commit fc57f88, which predates the official LLVM 19.0.0 release. Some tests need fixes: * The sized delete tests fail because clang-r536225 leaves sized deallocation off by default. * std::array<T[0]> is true when this Android Clang version is used with a trunk libc++, but we expect it to be false in the test. In practice, Clang and libc++ usually come from the same commit on Android.
1 parent ec5b729 commit 8f53a67

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
// These compiler versions don't enable sized deallocation by default.
1212
// UNSUPPORTED: clang-17, clang-18
1313

14+
// Android clang-r536225 identifies as clang-19.0 but it predates the real
15+
// LLVM 19.0.0, so it also leaves sized deallocation off by default.
16+
// UNSUPPORTED: android && clang-19.0
17+
1418
// UNSUPPORTED: sanitizer-new-delete, c++03, c++11
1519
// XFAIL: apple-clang
1620
// XFAIL: using-built-library-before-llvm-11

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
// These compiler versions do not enable sized deallocation by default.
1212
// UNSUPPORTED: clang-17, clang-18
1313

14+
// Android clang-r536225 identifies as clang-19.0 but it predates the real
15+
// LLVM 19.0.0, so it also leaves sized deallocation off by default.
16+
// UNSUPPORTED: android && clang-19.0
17+
1418
// UNSUPPORTED: sanitizer-new-delete, c++03, c++11
1519
// XFAIL: apple-clang
1620
// XFAIL: using-built-library-before-llvm-11

libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ typedef void (*FunctionPtr)();
7373
int main(int, char**)
7474
{
7575
test_is_array<char[3]>();
76+
// Android clang-r536225 identifies as clang-19.0, but it predates the
77+
// LLVM 19.0.0 release. It lacks llvm.org/pr86652, which changed __is_array
78+
// to return false for T[0]. llvm.org/pr93037 relies on that change for
79+
// correct handling of std::is_array<T[0]>. This test will pass as long as
80+
// Clang and libc++ come from the same LLVM commit, but we can't detect that
81+
// here.
82+
#if !defined(__ANDROID__) || TEST_CLANG_VER != 1900
7683
test_is_not_array<char[0]>();
84+
#endif
7785
test_is_array<char[]>();
7886
test_is_array<Union[]>();
7987

0 commit comments

Comments
 (0)