Commit ae53cf85 by David Edelsohn Committed by David Edelsohn

* g++.dg/cpp1y/pr58708.C: Define wfoo based on sizeof wchar_t.

From-SVN: r230516
parent cceac13f
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> 2015-11-17 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/plugin/diagnostic-test-expressions-1.c (vector): New * gcc.dg/plugin/diagnostic-test-expressions-1.c (vector): New
......
...@@ -43,7 +43,11 @@ main() ...@@ -43,7 +43,11 @@ main()
if (foo.chars[1] != 98) __builtin_abort(); if (foo.chars[1] != 98) __builtin_abort();
if (foo.chars[2] != 99) __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 (is_same<decltype(wfoo)::char_type, wchar_t>::value != true) __builtin_abort();
if (sizeof(wfoo.chars)/sizeof(wchar_t) != 2) __builtin_abort(); if (sizeof(wfoo.chars)/sizeof(wchar_t) != 2) __builtin_abort();
if (wfoo.chars[0] != 16909060) __builtin_abort(); if (wfoo.chars[0] != 16909060) __builtin_abort();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment