From ae53cf85a0674d2dee066e6104defd9ec817f89e Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Wed, 18 Nov 2015 00:43:59 +0000 Subject: [PATCH] * g++.dg/cpp1y/pr58708.C: Define wfoo based on sizeof wchar_t. From-SVN: r230516 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/cpp1y/pr58708.C | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1f14587d27..0c7900e3cff 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-11-17 David Edelsohn + + * g++.dg/cpp1y/pr58708.C: Define wfoo based on sizeof wchar_t. + 2015-11-17 David Malcolm * gcc.dg/plugin/diagnostic-test-expressions-1.c (vector): New diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58708.C b/gcc/testsuite/g++.dg/cpp1y/pr58708.C index 6fc374f1e56..3f39db8cfd4 100644 --- a/gcc/testsuite/g++.dg/cpp1y/pr58708.C +++ b/gcc/testsuite/g++.dg/cpp1y/pr58708.C @@ -43,7 +43,11 @@ main() if (foo.chars[1] != 98) __builtin_abort(); if (foo.chars[2] != 99) __builtin_abort(); - auto wfoo = L"\x01020304\x05060708"_foo; +#if __SIZEOF_WCHAR_T__ == 2 + auto wfoo = L"\x0102\x0304"_foo; +#else + auto wfoo = L"\x01020304\x05060708"_foo; +#endif if (is_same::value != true) __builtin_abort(); if (sizeof(wfoo.chars)/sizeof(wchar_t) != 2) __builtin_abort(); if (wfoo.chars[0] != 16909060) __builtin_abort(); -- 2.30.2