Page MenuHomePhabricator

[libc++][Android] Bionic also includes + for NAN
Needs ReviewPublic

Authored by rprichard on Dec 6 2022, 7:12 PM.

Details

Reviewers
danalbert
Group Reviewers
Restricted Project
Summary

However, it did not do so for Android L (APIs 21 and 22), so define a
compiler macro, _LIBCPP_TESTING_ANDROID_PRINTF_NAN_NO_SIGN, to adjust
the behavior of the facet.num.put.members/put_long_double.pass.cpp
test.

Diff Detail

Event Timeline

rprichard created this revision.Dec 6 2022, 7:12 PM
rprichard requested review of this revision.Dec 6 2022, 7:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 7:12 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
rprichard updated this revision to Diff 480743.Dec 6 2022, 7:21 PM

L MR1 (5.1) is API 22.

rprichard edited the summary of this revision. (Show Details)Dec 6 2022, 7:22 PM

I think we can use a simpler test, WDYT?

libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
10736

Would this work too?

rprichard added inline comments.Dec 12 2022, 4:07 PM
libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
10736

It ties the expected test output to the build API level of the test, which may not be what we want.

i.e. There are three API levels:

  • the build API level of libc++ itself
  • the build API of the libc++ tests (or the application code)
  • the runtime API level of the device

Currently for the NDK, the libc++ build API is typically 19 or 21, the app build API is typically low-ish (maybe 21/23?), and the runtime API steadily increases as people buy newer devices. It's normal for the build API for application code to be low (to target all the old devices in the wild), and the NDK only packages a single libc++_{shared.so,static.a} per CPU architecture.

This use of __ANDROID_API__ would break the test config in D139147, where the build API for libc++ and the tests is 21 (AndroidNDK.cmake, llvm-libc++abi-android-ndk.cfg.in), but the runtime API is 33 (Dockerfile.android).

A few nits and I'm happy.

libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
10736

I see, can you add the gist of this information to the comment in features.py.

10736

We typically only use _LIBCPP for configuration options in libc++ itself and not for the test suite.