diff mbox

g++.dg/cpp1y/pr58708.C testcase fix for AIX

Message ID CAGWvnymXYtuk5nZqV=Tqi2A3z-19PomLK1_1skWT9Xtzn3dKig@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Dec. 12, 2015, 1:11 p.m. UTC
I previously updated the assignment to correct the compile-time error,
but the runtime check of values also needs to be updated for 16 bit
wchar_t.

Tested on powerpc-ibm-aix7.1.0.0.

Committed.

Thanks, David

* g++.dg/cpp17/pr58708.C: Test appropriate value for size of wchar_t.

   if (is_same<decltype(foou)::char_type, char16_t>::value != true)
__builtin_abort();
diff mbox

Patch

Index: pr58708.C
===================================================================
--- pr58708.C   (revision 231582)
+++ pr58708.C   (working copy)
@@ -50,8 +50,13 @@ 
 #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 __SIZEOF_WCHAR_T__ == 2
+  if (wfoo.chars[0] != 258) __builtin_abort();
+  if (wfoo.chars[1] != 772) __builtin_abort();
+#else
   if (wfoo.chars[0] != 16909060) __builtin_abort();
   if (wfoo.chars[1] != 84281096) __builtin_abort();
+#endif

   auto foou = u"\x0102\x0304\x0506\x0708"_foo;