diff options
author | Denys Vlasenko | 2018-12-12 21:41:40 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-12-12 21:41:40 +0100 |
commit | 9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49 (patch) | |
tree | 9b1a85084b1e046b0a5b5eb06375334ef1eb2f56 /testsuite/bc_misc2.bc | |
parent | d6ad3666dc51f475a6e76b07f2c59d039f69f2d4 (diff) | |
download | busybox-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.zip busybox-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.tar.gz |
testsuite: add bc and dc tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/bc_misc2.bc')
-rw-r--r-- | testsuite/bc_misc2.bc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/bc_misc2.bc b/testsuite/bc_misc2.bc new file mode 100644 index 0000000..f5a6a6b --- /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 |