forked from OSchip/llvm-project
Fix wchar tests by not assuming that tm is complete and by using the
proper va_list time on non-darwin platforms. llvm-svn: 135247
This commit is contained in:
parent
4084c9ebe5
commit
bbe2b9dbc4
|
@ -32,10 +32,14 @@ int main()
|
||||||
{
|
{
|
||||||
mbstate_t mb = {0};
|
mbstate_t mb = {0};
|
||||||
size_t s = 0;
|
size_t s = 0;
|
||||||
tm tm = {0};
|
tm *tm = 0;
|
||||||
wint_t w = 0;
|
wint_t w = 0;
|
||||||
::FILE* fp = 0;
|
::FILE* fp = 0;
|
||||||
|
#ifdef __APPLE__
|
||||||
__darwin_va_list va;
|
__darwin_va_list va;
|
||||||
|
#else
|
||||||
|
__builtin_va_list va;
|
||||||
|
#endif
|
||||||
char* ns = 0;
|
char* ns = 0;
|
||||||
wchar_t* ws = 0;
|
wchar_t* ws = 0;
|
||||||
static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), "");
|
static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), "");
|
||||||
|
@ -88,7 +92,7 @@ int main()
|
||||||
static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), "");
|
static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), "");
|
||||||
static_assert((std::is_same<decltype(wmemmove(ws, L"", s)), wchar_t*>::value), "");
|
static_assert((std::is_same<decltype(wmemmove(ws, L"", s)), wchar_t*>::value), "");
|
||||||
static_assert((std::is_same<decltype(wmemset(ws, L' ', s)), wchar_t*>::value), "");
|
static_assert((std::is_same<decltype(wmemset(ws, L' ', s)), wchar_t*>::value), "");
|
||||||
static_assert((std::is_same<decltype(wcsftime(ws, s, L"", &tm)), size_t>::value), "");
|
static_assert((std::is_same<decltype(wcsftime(ws, s, L"", tm)), size_t>::value), "");
|
||||||
static_assert((std::is_same<decltype(btowc(0)), wint_t>::value), "");
|
static_assert((std::is_same<decltype(btowc(0)), wint_t>::value), "");
|
||||||
static_assert((std::is_same<decltype(wctob(w)), int>::value), "");
|
static_assert((std::is_same<decltype(wctob(w)), int>::value), "");
|
||||||
static_assert((std::is_same<decltype(mbsinit(&mb)), int>::value), "");
|
static_assert((std::is_same<decltype(mbsinit(&mb)), int>::value), "");
|
||||||
|
|
|
@ -32,10 +32,14 @@ int main()
|
||||||
{
|
{
|
||||||
std::mbstate_t mb = {0};
|
std::mbstate_t mb = {0};
|
||||||
std::size_t s = 0;
|
std::size_t s = 0;
|
||||||
std::tm tm = {0};
|
std::tm *tm = 0;
|
||||||
std::wint_t w = 0;
|
std::wint_t w = 0;
|
||||||
::FILE* fp = 0;
|
::FILE* fp = 0;
|
||||||
|
#ifdef __APPLE__
|
||||||
__darwin_va_list va;
|
__darwin_va_list va;
|
||||||
|
#else
|
||||||
|
__builtin_va_list va;
|
||||||
|
#endif
|
||||||
char* ns = 0;
|
char* ns = 0;
|
||||||
wchar_t* ws = 0;
|
wchar_t* ws = 0;
|
||||||
static_assert((std::is_same<decltype(std::fwprintf(fp, L"")), int>::value), "");
|
static_assert((std::is_same<decltype(std::fwprintf(fp, L"")), int>::value), "");
|
||||||
|
@ -93,7 +97,7 @@ int main()
|
||||||
static_assert((std::is_same<decltype(std::wmemcpy(ws, L"", s)), wchar_t*>::value), "");
|
static_assert((std::is_same<decltype(std::wmemcpy(ws, L"", s)), wchar_t*>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::wmemmove(ws, L"", s)), wchar_t*>::value), "");
|
static_assert((std::is_same<decltype(std::wmemmove(ws, L"", s)), wchar_t*>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::wmemset(ws, L' ', s)), wchar_t*>::value), "");
|
static_assert((std::is_same<decltype(std::wmemset(ws, L' ', s)), wchar_t*>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::wcsftime(ws, s, L"", &tm)), std::size_t>::value), "");
|
static_assert((std::is_same<decltype(std::wcsftime(ws, s, L"", tm)), std::size_t>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::btowc(0)), wint_t>::value), "");
|
static_assert((std::is_same<decltype(std::btowc(0)), wint_t>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::wctob(w)), int>::value), "");
|
static_assert((std::is_same<decltype(std::wctob(w)), int>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::mbsinit(&mb)), int>::value), "");
|
static_assert((std::is_same<decltype(std::mbsinit(&mb)), int>::value), "");
|
||||||
|
|
Loading…
Reference in New Issue