From 9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 12 Dec 2018 21:41:40 +0100 Subject: testsuite: add bc and dc tests Signed-off-by: Denys Vlasenko --- testsuite/bc_misc2.bc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 testsuite/bc_misc2.bc (limited to 'testsuite/bc_misc2.bc') diff --git a/testsuite/bc_misc2.bc b/testsuite/bc_misc2.bc new file mode 100644 index 000000000..f5a6a6b13 --- /dev/null +++ b/testsuite/bc_misc2.bc @@ -0,0 +1,45 @@ +define x() { +"x" +return ( 1 ) +} +define y() { +"y" +return (2) +} +define z() { +"z" +return (3) +} + +if ( x() == y() ) {1} +1 +if ( x() <= y() ) {2} +if ( y() >= x() ) {3} +if ( x() != y() ) {4} +if ( x() < y() ) {5} +if ( y() > x() ) {6} + +if ( x() == z() ) {11} +11 +if ( x() <= z() ) {12} +if ( z() >= x() ) {13} +if ( x() != z() ) {14} +if ( x() < z() ) {15} +if ( z() > x() ) {16} + +x = -10 +while (x <= 0) { + x + if (x == -5) break; + x += 1 +} + +define u() { + auto a[]; + return a[0] +} + +u() + +if (x == -4) x +else x - 4 -- cgit v1.2.3