summaryrefslogtreecommitdiffstats
path: root/llvm/test/TableGen
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-05-14 22:38:31 +0000
committerDavid Greene <greened@obbligato.org>2009-05-14 22:38:31 +0000
commitd571b3c94b087e8560a14a427d623d70b1a9011c (patch)
tree3d92bb86774ee7720f0541312ba042b8c6b3f9b8 /llvm/test/TableGen
parente917fff30f9bb8c24a656492449d72d8262c7d7f (diff)
downloadbcm5719-llvm-d571b3c94b087e8560a14a427d623d70b1a9011c.tar.gz
bcm5719-llvm-d571b3c94b087e8560a14a427d623d70b1a9011c.zip
Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.
Ok, not really, but do support some common LISP functions: * car * cdr * null llvm-svn: 71805
Diffstat (limited to 'llvm/test/TableGen')
-rw-r--r--llvm/test/TableGen/lisp.td21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/TableGen/lisp.td b/llvm/test/TableGen/lisp.td
new file mode 100644
index 00000000000..3e392fda84f
--- /dev/null
+++ b/llvm/test/TableGen/lisp.td
@@ -0,0 +1,21 @@
+// RUN: tblgen %s | grep {}
+
+class List<list<string> n> {
+ list<string> names = n;
+}
+
+class CAR<string e> {
+ string element = e;
+}
+
+class CDR<list<string> r, int n> {
+ list<string> rest = r;
+ int null = n;
+}
+
+class NameList<list<string> Names> :
+ List<Names>, CAR<!car(Names)>, CDR<!cdr(Names), !null(!cdr(Names))>;
+
+def Three : NameList<["Tom", "Dick", "Harry"]>;
+
+def One : NameList<["Jeffrey Sinclair"]>;
OpenPOWER on IntegriCloud