| 1 |
function foo:long (x:long) %{ /* bpf */ /* pure */ |
| 2 |
/* verify refusal to accept gibberish */ |
| 3 |
0xd33333333333333333333333333333333333333333333333333333333333333333333333333334db33f, $x, -, _bar, 10; /* XTREAM opcode */ |
| 4 |
/* 0xb7, $$, -, huirgishvirguwishgiburg, 100; /* XTREAM 3rd arg */ |
| 5 |
/* 0xb7, $$, -, -, borkborkborkborkbork; /* XTREAM 4th arg */ |
| 6 |
%} |
| 7 |
|
| 8 |
function bar:long (x:long) { |
| 9 |
if (x <= 10) return 50 else return 100 |
| 10 |
} |
| 11 |
|
| 12 |
probe begin { |
| 13 |
printf("foo(1)=%d should be %d\n", foo(1), bar(1)) |
| 14 |
printf("foo(8)=%d should be %d\n", foo(8), bar(8)) |
| 15 |
printf("foo(15)=%d should be %d\n", foo(15), bar(15)) |
| 16 |
exit() |
| 17 |
} |