* g++.dg/cpp1y/pr58708.C: Define wfoo based on sizeof wchar_t.
authorDavid Edelsohn <dje.gcc@gmail.com>
Wed, 18 Nov 2015 00:43:59 +0000 (00:43 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Wed, 18 Nov 2015 00:43:59 +0000 (19:43 -0500)
From-SVN: r230516

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr58708.C

index a1f14587d2740ef6f3843217b21d4ca16209e3a0..0c7900e3cffb4f0a2ca79fff25ac1b870a276d2a 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-17  David Edelsohn  <dje.gcc@gmail.com>
+
+       * g++.dg/cpp1y/pr58708.C: Define wfoo based on sizeof wchar_t.
+
 2015-11-17  David Malcolm  <dmalcolm@redhat.com>
 
        * gcc.dg/plugin/diagnostic-test-expressions-1.c (vector): New
index 6fc374f1e56a55035121142326f194a776f5b849..3f39db8cfd48f10790e1ee1188d11360b748e34e 100644 (file)
@@ -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<decltype(wfoo)::char_type, wchar_t>::value != true) __builtin_abort();
   if (sizeof(wfoo.chars)/sizeof(wchar_t) != 2) __builtin_abort();
   if (wfoo.chars[0] != 16909060) __builtin_abort();