diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2002-02-24 12:52:30 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-02-24 12:52:30 +0000 |
commit | a47ed31052e27000eb57521bb4c9e600a4768a98 (patch) | |
tree | b8bc66887f2c3523f7edef448ecb1be8ff9d481a /gcc/testsuite/gcc.dg/cpp/wchar-1.c | |
parent | cb8f73be28c7ad42f8244cc9e442c7559d39f725 (diff) | |
download | gcc-a47ed31052e27000eb57521bb4c9e600a4768a98.zip gcc-a47ed31052e27000eb57521bb4c9e600a4768a98.tar.gz gcc-a47ed31052e27000eb57521bb4c9e600a4768a98.tar.bz2 |
cpplex.c (cpp_interpret_charconst): Get signedness or otherwise of wide character constants correct.
* cpplex.c (cpp_interpret_charconst): Get signedness or
otherwise of wide character constants correct.
* cppexp.c (lex): Get signedness of wide charconsts correct.
* testsuite/gcc.dg/cpp/wchar-1.c: New test.
From-SVN: r50005
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/wchar-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/wchar-1.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/wchar-1.c b/gcc/testsuite/gcc.dg/cpp/wchar-1.c new file mode 100644 index 0000000..f93c1cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/wchar-1.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2002 Free Software Foundation, Inc. */ + +/* { dg-do run } */ + +/* Source: Neil Booth, 24 Feb 2002. + + Test if compiler and preprocessor agree on signeness of wide + chars. */ + +int main () +{ + __WCHAR_TYPE__ c = -1; + +#if L'\x0' - 1 < 0 + if (c > 0) + abort (); +#else + if (c < 0) + abort (); +#endif + + return 0; +} |