From 78122a2a360d631757dee375843fe6aa683f8d37 Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 31 Aug 2021 12:51:56 +0000 Subject: [PATCH] 'if' tests. --- regress/usr.sbin/btrace/Makefile | 4 ++-- regress/usr.sbin/btrace/if.bt | 12 ++++++++++++ regress/usr.sbin/btrace/if.ok | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 regress/usr.sbin/btrace/if.bt create mode 100644 regress/usr.sbin/btrace/if.ok 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! -- 2.20.1