Test local variables, boolean and print() of variables other than maps.
authormpi <mpi@openbsd.org>
Wed, 21 Apr 2021 10:30:46 +0000 (10:30 +0000)
committermpi <mpi@openbsd.org>
Wed, 21 Apr 2021 10:30:46 +0000 (10:30 +0000)
regress/usr.sbin/btrace/Makefile
regress/usr.sbin/btrace/arithm.bt
regress/usr.sbin/btrace/boolean.bt
regress/usr.sbin/btrace/boolean.ok
regress/usr.sbin/btrace/print.bt [new file with mode: 0644]
regress/usr.sbin/btrace/print.ok [new file with mode: 0644]

index 251163d..9310d32 100644 (file)
@@ -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=
 
index 552ce90..e2d35a8 100644 (file)
@@ -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);
 }
index 4de756f..41f02f4 100644 (file)
@@ -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);
+}
index 68b70a4..6fa0b90 100644 (file)
@@ -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 (file)
index 0000000..622f9c6
--- /dev/null
@@ -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 (file)
index 0000000..0da183e
--- /dev/null
@@ -0,0 +1,3 @@
+890
+string
+btrace