diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-12 21:41:40 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-12 21:41:40 +0100 |
commit | 9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49 (patch) | |
tree | 9b1a85084b1e046b0a5b5eb06375334ef1eb2f56 /testsuite/bc_misc2.bc | |
parent | d6ad3666dc51f475a6e76b07f2c59d039f69f2d4 (diff) | |
download | busybox-w32-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.tar.gz busybox-w32-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.tar.bz2 busybox-w32-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.zip |
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 000000000..f5a6a6b13 --- /dev/null +++ b/testsuite/bc_misc2.bc | |||
@@ -0,0 +1,45 @@ | |||
1 | define x() { | ||
2 | "x" | ||
3 | return ( 1 ) | ||
4 | } | ||
5 | define y() { | ||
6 | "y" | ||
7 | return (2) | ||
8 | } | ||
9 | define z() { | ||
10 | "z" | ||
11 | return (3) | ||
12 | } | ||
13 | |||
14 | if ( x() == y() ) {1} | ||
15 | 1 | ||
16 | if ( x() <= y() ) {2} | ||
17 | if ( y() >= x() ) {3} | ||
18 | if ( x() != y() ) {4} | ||
19 | if ( x() < y() ) {5} | ||
20 | if ( y() > x() ) {6} | ||
21 | |||
22 | if ( x() == z() ) {11} | ||
23 | 11 | ||
24 | if ( x() <= z() ) {12} | ||
25 | if ( z() >= x() ) {13} | ||
26 | if ( x() != z() ) {14} | ||
27 | if ( x() < z() ) {15} | ||
28 | if ( z() > x() ) {16} | ||
29 | |||
30 | x = -10 | ||
31 | while (x <= 0) { | ||
32 | x | ||
33 | if (x == -5) break; | ||
34 | x += 1 | ||
35 | } | ||
36 | |||
37 | define u() { | ||
38 | auto a[]; | ||
39 | return a[0] | ||
40 | } | ||
41 | |||
42 | u() | ||
43 | |||
44 | if (x == -4) x | ||
45 | else x - 4 | ||