[cfe-commits] r79841 - in /cfe/trunk/test/CXX/lex/lex.trigraph: p1.cpp p2.cpp p3.cpp

Daniel Dunbar daniel at zuster.org
Sun Aug 23 01:22:33 PDT 2009


Author: ddunbar
Date: Sun Aug 23 03:22:33 2009
New Revision: 79841

URL: http://llvm.org/viewvc/llvm-project?rev=79841&view=rev
Log:
Tests for C++ lex.trigraph, patch by Mats!

Added:
    cfe/trunk/test/CXX/lex/lex.trigraph/p1.cpp
    cfe/trunk/test/CXX/lex/lex.trigraph/p2.cpp
    cfe/trunk/test/CXX/lex/lex.trigraph/p3.cpp

Added: cfe/trunk/test/CXX/lex/lex.trigraph/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/lex/lex.trigraph/p1.cpp?rev=79841&view=auto

==============================================================================
--- cfe/trunk/test/CXX/lex/lex.trigraph/p1.cpp (added)
+++ cfe/trunk/test/CXX/lex/lex.trigraph/p1.cpp Sun Aug 23 03:22:33 2009
@@ -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}}

Added: cfe/trunk/test/CXX/lex/lex.trigraph/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/lex/lex.trigraph/p2.cpp?rev=79841&view=auto

==============================================================================
--- cfe/trunk/test/CXX/lex/lex.trigraph/p2.cpp (added)
+++ cfe/trunk/test/CXX/lex/lex.trigraph/p2.cpp Sun Aug 23 03:22:33 2009
@@ -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}}

Added: cfe/trunk/test/CXX/lex/lex.trigraph/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/lex/lex.trigraph/p3.cpp?rev=79841&view=auto

==============================================================================
--- cfe/trunk/test/CXX/lex/lex.trigraph/p3.cpp (added)
+++ cfe/trunk/test/CXX/lex/lex.trigraph/p3.cpp Sun Aug 23 03:22:33 2009
@@ -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??{??|??}??~";





More information about the cfe-commits mailing list