changeset 126:cb08e397ce7b

Test nested ifs.
author David A. Holland
date Wed, 12 Jun 2013 10:51:10 -0400
parents 4e98022c3ce2
children a0a86380456e
files tests/Makefile tests/t28.c tests/t28.good tests/t29.c tests/t29.good
diffstat 4 files changed, 60 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/Makefile	Tue Jun 11 19:14:17 2013 -0400
+++ b/tests/Makefile	Wed Jun 12 10:51:10 2013 -0400
@@ -3,7 +3,7 @@
 
 TESTS=\
 	t01 t02 t03 t04 t05 t06 t07 t08 t09 t10 t11 t12 t13 t14 t15 t16 \
-	t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27
+	t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27 t28 t29
 
 all: run-tests .WAIT show-diffs
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/t28.c	Wed Jun 12 10:51:10 2013 -0400
@@ -0,0 +1,53 @@
+#if 1
+. right
+
+# if 1
+.. right
+# elif 1
+.. wrong
+# elif 0
+.. wrong
+# else
+.. wrong
+# endif
+
+#elif 1
+. wrong
+
+# if 1
+.. wrong
+# elif 1
+.. wrong
+# elif 0
+.. wrong
+# else
+.. wrong
+# endif
+
+#elif 0
+. wrong
+
+# if 1
+.. wrong
+# elif 1
+.. wrong
+# elif 0
+.. wrong
+# else
+.. wrong
+# endif
+
+#else
+. wrong
+
+# if 1
+.. wrong
+# elif 1
+.. wrong
+# elif 0
+.. wrong
+# else
+.. wrong
+# endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/t28.good	Wed Jun 12 10:51:10 2013 -0400
@@ -0,0 +1,2 @@
+. right
+.. right
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/t29.c	Wed Jun 12 10:51:10 2013 -0400
@@ -0,0 +1,4 @@
+#if 0
+# if this is a syntax error
+# endif
+#endif