From 425ecdb789c959cc9b0a0cd72f6b0b86e7411c71 Mon Sep 17 00:00:00 2001 From: mpi Date: Mon, 11 Sep 2023 19:03:53 +0000 Subject: [PATCH] Regressions for tuples and evaluating variables. --- regress/usr.sbin/btrace/Makefile | 4 ++-- regress/usr.sbin/btrace/tuple.bt | 4 ++++ regress/usr.sbin/btrace/tuple.ok | 1 + regress/usr.sbin/btrace/tupleeval.bt | 8 ++++++++ regress/usr.sbin/btrace/tupleeval.ok | 1 + regress/usr.sbin/btrace/vareval.bt | 5 +++++ regress/usr.sbin/btrace/vareval.ok | 1 + 7 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 regress/usr.sbin/btrace/tuple.bt create mode 100644 regress/usr.sbin/btrace/tuple.ok create mode 100644 regress/usr.sbin/btrace/tupleeval.bt create mode 100644 regress/usr.sbin/btrace/tupleeval.ok create mode 100644 regress/usr.sbin/btrace/vareval.bt create mode 100644 regress/usr.sbin/btrace/vareval.ok diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile index a5b37cbab83..6f0bb76d387 100644 --- a/regress/usr.sbin/btrace/Makefile +++ b/regress/usr.sbin/btrace/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.29 2023/09/02 19:28:46 dv Exp $ +# $OpenBSD: Makefile,v 1.30 2023/09/11 19:03:53 mpi Exp $ BTRACE?= /usr/sbin/btrace ALLOWDT!= sysctl -n kern.allowdt 2>/dev/null @@ -9,7 +9,7 @@ BT_LANG_SCRIPTS= arithm beginend beginend-argn boolean comments delete \ map mapclear mapempty mapsyntax mapzero map-unnamed \ maxoperand min+max+sum multismts nsecs+var \ precedence print read-map-after-clear staticv-empty \ - syntaxerror + syntaxerror tuple tupleeval vareval BT_ARG_LANG_SCRIPTS= staticv str diff --git a/regress/usr.sbin/btrace/tuple.bt b/regress/usr.sbin/btrace/tuple.bt new file mode 100644 index 00000000000..80124c4878a --- /dev/null +++ b/regress/usr.sbin/btrace/tuple.bt @@ -0,0 +1,4 @@ +BEGIN { + $t = (1, 42, "something"); + printf("%d %s\n", $t.1, $t.2); +} diff --git a/regress/usr.sbin/btrace/tuple.ok b/regress/usr.sbin/btrace/tuple.ok new file mode 100644 index 00000000000..a75bd975a86 --- /dev/null +++ b/regress/usr.sbin/btrace/tuple.ok @@ -0,0 +1 @@ +42 something diff --git a/regress/usr.sbin/btrace/tupleeval.bt b/regress/usr.sbin/btrace/tupleeval.bt new file mode 100644 index 00000000000..aeee95c6dbd --- /dev/null +++ b/regress/usr.sbin/btrace/tupleeval.bt @@ -0,0 +1,8 @@ +BEGIN { + $t = (5, comm, "str", probe); + @u = $t; +} + +END { + print(@u) +} diff --git a/regress/usr.sbin/btrace/tupleeval.ok b/regress/usr.sbin/btrace/tupleeval.ok new file mode 100644 index 00000000000..ea54e1e11cb --- /dev/null +++ b/regress/usr.sbin/btrace/tupleeval.ok @@ -0,0 +1 @@ +(5, btrace, str, BEGIN) diff --git a/regress/usr.sbin/btrace/vareval.bt b/regress/usr.sbin/btrace/vareval.bt new file mode 100644 index 00000000000..3ea83a52dc1 --- /dev/null +++ b/regress/usr.sbin/btrace/vareval.bt @@ -0,0 +1,5 @@ +BEGIN { + $tmp = 5; + @t = $tmp; + @m[42] = @t; +} diff --git a/regress/usr.sbin/btrace/vareval.ok b/regress/usr.sbin/btrace/vareval.ok new file mode 100644 index 00000000000..366a59e1349 --- /dev/null +++ b/regress/usr.sbin/btrace/vareval.ok @@ -0,0 +1 @@ +@m[42]: 5 -- 2.20.1