summaryrefslogtreecommitdiff
path: root/regress/usr.sbin
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2021-08-31 12:51:57 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2021-08-31 12:51:57 +0000
commitf5cb00e00e1f99be36dc76f5f11b84ce72811b15 (patch)
tree0c3560b90da12f049416db9a80df849a40db990c /regress/usr.sbin
parent08c1c2ee5d9c77fc65cd84541b720a75145fee12 (diff)
'if' tests.
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r--regress/usr.sbin/btrace/Makefile4
-rw-r--r--regress/usr.sbin/btrace/if.bt12
-rw-r--r--regress/usr.sbin/btrace/if.ok1
3 files changed, 15 insertions, 2 deletions
diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile
index c5777834d0c..145512cf65a 100644
--- a/regress/usr.sbin/btrace/Makefile
+++ b/regress/usr.sbin/btrace/Makefile
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.10 2021/08/31 08:39:46 mpi Exp $
+# $OpenBSD: Makefile,v 1.11 2021/08/31 12:51:56 mpi Exp $
BTRACE?= /usr/sbin/btrace
# scripts that don't need /dev/dt
-BT_LANG_SCRIPTS= arithm beginend boolean comments delete exit map \
+BT_LANG_SCRIPTS= arithm beginend boolean comments delete exit if map \
map-unnamed maxoperand min+max+sum multismts nsecs+var \
precedence print
diff --git a/regress/usr.sbin/btrace/if.bt b/regress/usr.sbin/btrace/if.bt
new file mode 100644
index 00000000000..f11d67b645e
--- /dev/null
+++ b/regress/usr.sbin/btrace/if.bt
@@ -0,0 +1,12 @@
+BEGIN {
+ if (0)
+ printf("nothing");
+
+ @var = 0;
+ if (@var)
+ printf("not printed\n");
+
+ if (1) {
+ printf("printed!\n");
+ }
+}
diff --git a/regress/usr.sbin/btrace/if.ok b/regress/usr.sbin/btrace/if.ok
new file mode 100644
index 00000000000..28bc8a945d3
--- /dev/null
+++ b/regress/usr.sbin/btrace/if.ok
@@ -0,0 +1 @@
+printed!