diff options
author | Dave Voutila <dv@cvs.openbsd.org> | 2023-12-20 14:00:18 +0000 |
---|---|---|
committer | Dave Voutila <dv@cvs.openbsd.org> | 2023-12-20 14:00:18 +0000 |
commit | d35cdd32c57db73d4688b1bc8fe7458d063cd576 (patch) | |
tree | f73a59e77828729e038e80489013c156b15dda83 /regress | |
parent | 9fa06564de0af28ac9c991784803227160c3ce0a (diff) |
btrace: add support for hex and octal values.
Changes number tokenizing and parsing to support hex & octal values.
Does not address other lexer issues (e.g. $0x1) to close gaps with
bpftrace.
OK claudio@
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.sbin/btrace/arithm.bt | 5 | ||||
-rw-r--r-- | regress/usr.sbin/btrace/arithm.ok | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/regress/usr.sbin/btrace/arithm.bt b/regress/usr.sbin/btrace/arithm.bt index e2d35a83a1b..58638e7c93a 100644 --- a/regress/usr.sbin/btrace/arithm.bt +++ b/regress/usr.sbin/btrace/arithm.bt @@ -3,7 +3,7 @@ BEGIN @a = 10; @b = 5; - printf("a + b = %d\n", @a + @b); + printf("a + b + 0xf = %d\n", @a + @b + 0xf); } END @@ -11,5 +11,6 @@ END printf("a - b = %d\n", @a - @b); $c = @a + 2 * @b; - printf("c = %d, total = %d\n", $c, ($c - @b) / 5); + $d = @a + 0xf5; + printf("c = %d, d = 0x%x, total = %d\n", $c, $d, ($c - @b) / 5); } diff --git a/regress/usr.sbin/btrace/arithm.ok b/regress/usr.sbin/btrace/arithm.ok index 9575561d2be..0c05e397b1a 100644 --- a/regress/usr.sbin/btrace/arithm.ok +++ b/regress/usr.sbin/btrace/arithm.ok @@ -1,3 +1,3 @@ -a + b = 15 +a + b + 0xf = 30 a - b = 5 -c = 20, total = 3 +c = 20, d = 0xff, total = 3 |