summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/btrace/if.bt
diff options
context:
space:
mode:
Diffstat (limited to 'regress/usr.sbin/btrace/if.bt')
-rw-r--r--regress/usr.sbin/btrace/if.bt29
1 files changed, 29 insertions, 0 deletions
diff --git a/regress/usr.sbin/btrace/if.bt b/regress/usr.sbin/btrace/if.bt
index 053801cac54..41f30815ba5 100644
--- a/regress/usr.sbin/btrace/if.bt
+++ b/regress/usr.sbin/btrace/if.bt
@@ -9,6 +9,20 @@ BEGIN {
if (1) {
printf("printed!\n");
}
+
+ if (0)
+ printf("simple if\n");
+ else
+ printf("simple else\n");
+
+ if (0) {
+ printf("disabled if\n");
+ } else if (1) {
+ printf("multiple statements in ");
+ printf("else-if branch\n");
+ } else {
+ printf("no else\n");
+ }
}
END {
@@ -18,4 +32,19 @@ END {
printf("(%d) ", @var);
printf("statements\n");
}
+
+ if (0) printf("single-line if\n"); else printf("single-line else\n");
+
+ if (0) {
+ printf("not printed\n");
+ } else {
+ if (0) {
+ printf("nested not printed\n");
+ } else {
+ printf("nested printed\n");
+ exit();
+ printf("nested not printed\n");
+ }
+ printf("also not printed\n");
+ }
}