'if' tests.
authormpi <mpi@openbsd.org>
Tue, 31 Aug 2021 12:51:56 +0000 (12:51 +0000)
committermpi <mpi@openbsd.org>
Tue, 31 Aug 2021 12:51:56 +0000 (12:51 +0000)
regress/usr.sbin/btrace/Makefile
regress/usr.sbin/btrace/if.bt [new file with mode: 0644]
regress/usr.sbin/btrace/if.ok [new file with mode: 0644]

index c577783..145512c 100644 (file)
@@ -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 (file)
index 0000000..f11d67b
--- /dev/null
@@ -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 (file)
index 0000000..28bc8a9
--- /dev/null
@@ -0,0 +1 @@
+printed!