Tests for C++ lex.trigraph, patch by Mats!

llvm-svn: 79841
This commit is contained in:
Daniel Dunbar 2009-08-23 08:22:33 +00:00
parent 6973395cc7
commit 0ad0c21248
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,19 @@
// RUN: clang-cc -fsyntax-only -trigraphs -Wtrigraphs -verify %s
??=pragma // expected-warning {{trigraph converted to '#' character}}
int a = '??/0'; // expected-warning {{trigraph converted to '\' character}}
int b = 1 ??' 0; // expected-warning {{trigraph converted to '^' character}}
int c ??(1]; // expected-warning {{trigraph converted to '[' character}}
int d [1??); // expected-warning {{trigraph converted to ']' character}}
int e = 1 ??! 0; // expected-warning {{trigraph converted to '|' character}}
void f() ??<} // expected-warning {{trigraph converted to '{' character}}
void g() {??> // expected-warning {{trigraph converted to '}' character}}
int h = ??- 0; // expected-warning {{trigraph converted to '~' character}}

View File

@ -0,0 +1,3 @@
// RUN: clang-cc -fsyntax-only -trigraphs -Wtrigraphs -verify %s
??=define arraycheck(a,b) a??(b??) ??!??! b??(a??) // expected-warning {{trigraph converted to '#' character}} expected-warning {{trigraph converted to '[' character}} expected-warning {{trigraph converted to ']' character}} expected-warning {{trigraph converted to '|' character}} expected-warning {{trigraph converted to '|' character}} expected-warning {{trigraph converted to '[' character}} expected-warning {{trigraph converted to ']' character}}

View File

@ -0,0 +1,8 @@
// RUN: clang-cc -fsyntax-only -trigraphs -Wtrigraphs -verify %s
char a[] =
"?? ??\"??#??$??%??&??*??+??,??.??0??1??2??3??4??5??6"
"??7??8??9??:??;?????@??A??B??C??D??E??F??G??H??I??J"
"??K??L??M??N??O??P??Q??R??S??T??U??V??W??X??Y??Z??["
"??\\??]??^??_??`??a??b??c??d??e??f??g??h??i??j??k??l"
"??m??n??o??p??q??r??s??t??u??v??w??x??y??z??{??|??}??~";