2009-04-29 02:52:02 +08:00
|
|
|
// RUN: clang-cc -fsyntax-only -verify -pedantic -trigraphs %s
|
2007-07-16 14:55:01 +08:00
|
|
|
|
2009-04-29 02:43:12 +08:00
|
|
|
int x = 000000080; // expected-error {{invalid digit}}
|
2007-07-16 14:55:01 +08:00
|
|
|
|
|
|
|
int y = 0000\
|
2009-04-29 02:43:12 +08:00
|
|
|
00080; // expected-error {{invalid digit}}
|
2007-07-16 14:55:01 +08:00
|
|
|
|
2009-04-29 02:43:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
float X = 1.17549435e-38F;
|
|
|
|
float Y = 08.123456;
|
|
|
|
|
|
|
|
// PR2252
|
|
|
|
#if -0x8000000000000000 // should not warn.
|
|
|
|
#endif
|
2009-04-29 02:52:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
char c[] = {
|
2009-04-29 05:51:46 +08:00
|
|
|
'df', // expected-warning {{multi-character character constant}}
|
2009-04-29 02:52:02 +08:00
|
|
|
'\t',
|
|
|
|
'\\
|
|
|
|
t',
|
2009-04-29 05:51:46 +08:00
|
|
|
'??!', // expected-warning {{trigraph converted to '|' character}}
|
|
|
|
'abcd' // expected-warning {{multi-character character constant}}
|
2009-04-29 02:52:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-05-13 02:21:11 +08:00
|
|
|
#pragma clang diagnostic ignored "-Wmultichar"
|
2009-04-29 02:52:02 +08:00
|
|
|
|
|
|
|
char d = 'df'; // no warning.
|
2009-04-29 05:51:46 +08:00
|
|
|
char e = 'abcd'; // still warn: expected-warning {{multi-character character constant}}
|
|
|
|
|
2009-05-13 02:21:11 +08:00
|
|
|
#pragma clang diagnostic ignored "-Wfour-char-constants"
|
2009-04-29 05:51:46 +08:00
|
|
|
|
|
|
|
char f = 'abcd'; // ignored.
|