Skip to content

Commit a586d0e

Browse files
committed
Replace #if with UNSUPPORTED.
We can't use XFAIL yet because the old sysroot used in the Android CI Docker image still declares these functions even for pre-API 26. The new sysroot we want to switch stop drops the declarations, unless the code is targeting API 26 or newer.
1 parent 5ed3094 commit a586d0e

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
// test <stdlib.h>
1010

11+
// mblen was added in Android API 26.
12+
// TODO: Switch from UNSUPPORTED to XFAIL once the Android CI Docker sysroot is
13+
// updated.
14+
// UNSUPPORTED: LIBCXX-ANDROID-FIXME && target={{.+}}-android{{(eabi)?(21|22|23|24|25)}}
15+
1116
#include <stdlib.h>
1217
#include <cassert>
1318
#include <type_traits>
@@ -141,10 +146,7 @@ int main(int, char**) {
141146
wchar_t* pw = 0;
142147
const wchar_t* pwc = 0;
143148
char* pc = 0;
144-
// mblen was added in Android API 26.
145-
# if !defined(__ANDROID__) || __ANDROID_API__ >= 26
146149
ASSERT_SAME_TYPE(int, decltype(mblen("",0)));
147-
# endif
148150
ASSERT_SAME_TYPE(int, decltype(mbtowc(pw,"",0)));
149151
ASSERT_SAME_TYPE(int, decltype(wctomb(pc,L' ')));
150152
ASSERT_SAME_TYPE(size_t, decltype(mbstowcs(pw,"",0)));

libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
// UNSUPPORTED: no-wide-characters
1010

11+
// towctrans and wctrans were added in Android API 26.
12+
// TODO: Switch from UNSUPPORTED to XFAIL once the Android CI Docker sysroot is
13+
// updated.
14+
// UNSUPPORTED: LIBCXX-ANDROID-FIXME && target={{.+}}-android{{(eabi)?(21|22|23|24|25)}}
15+
1116
// <wctype.h>
1217

1318
#include <wctype.h>
@@ -109,8 +114,5 @@ ASSERT_SAME_TYPE(int, decltype(iswctype(w, wct)));
109114
ASSERT_SAME_TYPE(wctype_t, decltype(wctype("")));
110115
ASSERT_SAME_TYPE(wint_t, decltype(towlower(w)));
111116
ASSERT_SAME_TYPE(wint_t, decltype(towupper(w)));
112-
// towctrans and wctrans were added in Android API 26.
113-
#if !defined(__ANDROID__) || __ANDROID_API__ >= 26
114117
ASSERT_SAME_TYPE(wint_t, decltype(towctrans(w, wctr)));
115118
ASSERT_SAME_TYPE(wctrans_t, decltype(wctrans("")));
116-
#endif

libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
// test <cstdlib>
1010

11+
// mblen was added in Android API 26.
12+
// TODO: Switch from UNSUPPORTED to XFAIL once the Android CI Docker sysroot is
13+
// updated.
14+
// UNSUPPORTED: LIBCXX-ANDROID-FIXME && target={{.+}}-android{{(eabi)?(21|22|23|24|25)}}
15+
1116
#include <cstdlib>
1217
#include <cassert>
1318
#include <type_traits>
@@ -141,10 +146,7 @@ int main(int, char**)
141146
wchar_t* pw = 0;
142147
const wchar_t* pwc = 0;
143148
char* pc = 0;
144-
// mblen was added in Android API 26.
145-
# if !defined(__ANDROID__) || __ANDROID_API__ >= 26
146149
static_assert((std::is_same<decltype(std::mblen("",0)), int>::value), "");
147-
# endif
148150
static_assert((std::is_same<decltype(std::mbtowc(pw,"",0)), int>::value), "");
149151
static_assert((std::is_same<decltype(std::wctomb(pc,L' ')), int>::value), "");
150152
static_assert((std::is_same<decltype(std::mbstowcs(pw,"",0)), std::size_t>::value), "");

libcxx/test/std/strings/c.strings/cwctype.pass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
// UNSUPPORTED: no-wide-characters
1212

13+
// towctrans and wctrans were added in Android API 26.
14+
// TODO: Switch from UNSUPPORTED to XFAIL once the Android CI Docker sysroot is
15+
// updated.
16+
// UNSUPPORTED: LIBCXX-ANDROID-FIXME && target={{.+}}-android{{(eabi)?(21|22|23|24|25)}}
17+
1318
#include <cwctype>
1419
#include <type_traits>
1520

@@ -111,11 +116,8 @@ int main(int, char**) {
111116
ASSERT_SAME_TYPE(std::wctype_t, decltype(std::wctype("")));
112117
ASSERT_SAME_TYPE(std::wint_t, decltype(std::towlower(w)));
113118
ASSERT_SAME_TYPE(std::wint_t, decltype(std::towupper(w)));
114-
// towctrans and wctrans were added in Android API 26.
115-
#if !defined(__ANDROID__) || __ANDROID_API__ >= 26
116119
ASSERT_SAME_TYPE(std::wint_t, decltype(std::towctrans(w, std::wctrans_t())));
117120
ASSERT_SAME_TYPE(std::wctrans_t, decltype(std::wctrans("")));
118-
#endif
119121

120122
return 0;
121123
}

0 commit comments

Comments
 (0)