diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-10-22 12:26:44 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-10-22 12:26:44 +0000 |
commit | c48c96e7134a92d494a87fa1a04d3e48aa87f584 (patch) | |
tree | 25061265ac3cfba7f0cb287f144af82a6d5cde0f /regress | |
parent | 21823a166aabdaf10a6d5ba635a68374b31914c1 (diff) |
Regressions for if ... else.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/bc/Makefile | 5 | ||||
-rw-r--r-- | regress/usr.bin/bc/t11.in | 12 | ||||
-rw-r--r-- | regress/usr.bin/bc/t11.out | 11 |
3 files changed, 26 insertions, 2 deletions
diff --git a/regress/usr.bin/bc/Makefile b/regress/usr.bin/bc/Makefile index 2fda2dc6ea9..913942f492f 100644 --- a/regress/usr.bin/bc/Makefile +++ b/regress/usr.bin/bc/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.3 2003/10/19 19:22:48 otto Exp $ +# $OpenBSD: Makefile,v 1.4 2003/10/22 12:26:43 otto Exp $ BC=bc -REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 +REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 # .in: input file # .out: desired result @@ -17,6 +17,7 @@ REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 # t8: continue ops # t9: more continue # t10: for with empty E's +# t11: if else all: clean ${REGRESS_TARGET} diff --git a/regress/usr.bin/bc/t11.in b/regress/usr.bin/bc/t11.in new file mode 100644 index 00000000000..afd46f4ab37 --- /dev/null +++ b/regress/usr.bin/bc/t11.in @@ -0,0 +1,12 @@ +for (i = 0; i < 5; i++) { + if (i > 0) { + if (i < 3) { + "i > 0 && i < 3" + } else { + "i > 0 && i >= 3" + } + } else "i == 0" + " " + if (i == 0) "0 " else if (i == 1) "1 " else "* " + i +} diff --git a/regress/usr.bin/bc/t11.out b/regress/usr.bin/bc/t11.out new file mode 100644 index 00000000000..4f77102e746 --- /dev/null +++ b/regress/usr.bin/bc/t11.out @@ -0,0 +1,11 @@ +[[i > 0 && i < 3]P]s2 +[[i > 0 && i >= 3]P]s3 +[li 3>2e3 ]s1 +[[i == 0]P]s4 +[[1 ]P]s7 +[[* ]P]s8 +[[0 ]P]s5 +[li 1=7e8 ]s6 +[li 0<1e4 [ ]Pli 0=5e6 lips.lid1+sis.li 5>0]s0 + 0dsis.li 5>0 +q
\ No newline at end of file |