diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/fshort-wchar.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/fshort-wchar.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fshort-wchar.c b/gcc/testsuite/gcc.dg/fshort-wchar.c new file mode 100644 index 000000000..c9c751504 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fshort-wchar.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2002 Free Software Foundation, Inc. */ + +/* { dg-do run } */ +/* { dg-options "-fshort-wchar" } */ +/* { dg-options "-fshort-wchar -Wl,--no-wchar-size-warning" { target arm*-*-*eabi } } */ + +/* Source: Neil Booth, 10 Dec 2002. + + Test that __WCHAR_MAX__ is correct with -fshort-wchar. */ + +extern void abort (void); + +int main () +{ + __WCHAR_TYPE__ w = ~(__WCHAR_TYPE__) 0; + + if (w != __WCHAR_MAX__) + abort (); + + return 0; +} |