2009-12-16 04:14:24 +08:00
/* RUN: %clang_cc1 -std=c90 -fsyntax-only %s -verify -pedantic-errors
2008-07-26 02:42:46 +08:00
*/
2007-11-15 00:14:50 +08:00
enum { cast_hex = ( long ) (
2008-07-26 02:42:46 +08:00
0x0 p - 1 /* expected-error {{hexadecimal floating constants are a C99 feature}} */
2007-11-15 00:14:50 +08:00
) } ;
2009-01-17 06:39:25 +08:00
/* PR2477 */
int test1 ( int a , int b ) { return a //* This is a divide followed by block comment in c89 mode */
b ; }
// comment accepted as extension /* expected-error {{// comments are not allowed in this language}}
2010-07-20 22:33:20 +08:00
void test2 ( ) {
const char * str =
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds " // expected-error{{string literal of length 845 exceeds maximum length 509 that C90 compilers are required to support}}
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds "
" sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds " ;
}