diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2021-04-21 10:30:47 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2021-04-21 10:30:47 +0000 |
commit | fb7f5eeab5f575d51e4e20f4754fbda41eb2bb16 (patch) | |
tree | 3d3dde95d82b83c8da01d3c491462fdab06e3f5d /regress | |
parent | 80eabe636e7094d62b2ffae11cd437a2c84babe9 (diff) |
Test local variables, boolean and print() of variables other than maps.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.sbin/btrace/Makefile | 5 | ||||
-rw-r--r-- | regress/usr.sbin/btrace/arithm.bt | 4 | ||||
-rw-r--r-- | regress/usr.sbin/btrace/boolean.bt | 8 | ||||
-rw-r--r-- | regress/usr.sbin/btrace/boolean.ok | 4 | ||||
-rw-r--r-- | regress/usr.sbin/btrace/print.bt | 7 | ||||
-rw-r--r-- | regress/usr.sbin/btrace/print.ok | 3 |
6 files changed, 25 insertions, 6 deletions
diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile index 251163dd58b..9310d320247 100644 --- a/regress/usr.sbin/btrace/Makefile +++ b/regress/usr.sbin/btrace/Makefile @@ -1,10 +1,11 @@ -# $OpenBSD: Makefile,v 1.8 2020/12/16 18:44:55 bluhm Exp $ +# $OpenBSD: Makefile,v 1.9 2021/04/21 10:30:46 mpi Exp $ BTRACE?= /usr/sbin/btrace # scripts that don't need /dev/dt BT_LANG_SCRIPTS= arithm beginend boolean comments delete exit map \ - map-unnamed maxoperand min+max+sum multismts nsecs+var + map-unnamed maxoperand min+max+sum multismts nsecs+var \ + print BT_KERN_SCRIPTS= diff --git a/regress/usr.sbin/btrace/arithm.bt b/regress/usr.sbin/btrace/arithm.bt index 552ce9082f0..e2d35a83a1b 100644 --- a/regress/usr.sbin/btrace/arithm.bt +++ b/regress/usr.sbin/btrace/arithm.bt @@ -10,6 +10,6 @@ END { printf("a - b = %d\n", @a - @b); - @c = @a + 2 * @b; - printf("c = %d, total = %d\n", @c, (@c - @b) / 5); + $c = @a + 2 * @b; + printf("c = %d, total = %d\n", $c, ($c - @b) / 5); } diff --git a/regress/usr.sbin/btrace/boolean.bt b/regress/usr.sbin/btrace/boolean.bt index 4de756f9187..41f02f4521d 100644 --- a/regress/usr.sbin/btrace/boolean.bt +++ b/regress/usr.sbin/btrace/boolean.bt @@ -1,8 +1,14 @@ BEGIN { - @a = 9; + @a = 8; @b = 1; printf("a & b = %d\n", @a & @b); printf("a | b = %d\n", @a | @b); } + +END +{ + printf("a && b = %d\n", @a && @b); + printf("a || b = %d\n", @a || @b); +} diff --git a/regress/usr.sbin/btrace/boolean.ok b/regress/usr.sbin/btrace/boolean.ok index 68b70a4e3fc..6fa0b9007eb 100644 --- a/regress/usr.sbin/btrace/boolean.ok +++ b/regress/usr.sbin/btrace/boolean.ok @@ -1,2 +1,4 @@ -a & b = 1 +a & b = 0 a | b = 9 +a && b = 1 +a || b = 1 diff --git a/regress/usr.sbin/btrace/print.bt b/regress/usr.sbin/btrace/print.bt new file mode 100644 index 00000000000..622f9c61a28 --- /dev/null +++ b/regress/usr.sbin/btrace/print.bt @@ -0,0 +1,7 @@ +BEGIN { + $str = "string"; + + print(890); + print($str); + print(comm); +} diff --git a/regress/usr.sbin/btrace/print.ok b/regress/usr.sbin/btrace/print.ok new file mode 100644 index 00000000000..0da183e9001 --- /dev/null +++ b/regress/usr.sbin/btrace/print.ok @@ -0,0 +1,3 @@ +890 +string +btrace |