+2008-05-06 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * lib/target_supports.exp (check_effective_target_4byte_wchar_t):
+ New proc.
+ * gcc.dg/utf16-4.c: Use it.
+ * gcc.dg/utf32-4.c: Use it.
+ * g++.dg/ext/utf16-4.C: Use it.
+ * gcc.dg/ext/utf32-4.C: Use it.
+
2008-05-05 Danny Smith <dannysmith@users.sourceforge.net>
* gfortran.dg/dev_null.f90. Remove and replace with...
const static char16_t c6 = U'\U00064321'; /* { dg-warning "implicitly truncated" } */
const static char16_t c7 = L'a';
const static char16_t c8 = L'\u2029';
-const static char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" } */
-
+const static char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } 16 } */
+ /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } 16 } */
int main () {}
const static char32_t c6 = u'\U00064321'; /* { dg-warning "constant too long" } */
const static char32_t c7 = L'a';
const static char32_t c8 = L'\u2029';
-const static char32_t c9 = L'\U00064321';
+const static char32_t c9 = L'\U00064321'; /* { dg-warning "constant too long" { target { ! 4byte_wchar_t } } } */
int main () {}
char16_t c6 = U'\U00064321'; /* { dg-warning "implicitly truncated" } */
char16_t c7 = L'a';
char16_t c8 = L'\u2029';
-char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" } */
+char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } 18 } */
+ /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } 18 } */
int main () {}
char32_t c6 = u'\U00064321'; /* { dg-warning "constant too long" } */
char32_t c7 = L'a';
char32_t c8 = L'\u2029';
-char32_t c9 = L'\U00064321';
+char32_t c9 = L'\U00064321'; /* { dg-warning "constant too long" { target { ! 4byte_wchar_t } } } */
int main () {}
$contents [add_options_for_c99_runtime ""]
}]
}
+
+# Return 1 if target wchar_t is at least 4 bytes.
+
+proc check_effective_target_4byte_wchar_t { } {
+ return [check_no_compiler_messages 4byte_wchar_t object {
+ int dummy[sizeof (wchar_t) >= 4 ? 1 : -1];
+ }]
+}