| 1 |
# simple test for the @const operator added per PR19926 |
| 2 |
|
| 3 |
set test "const_op" |
| 4 |
|
| 5 |
set ::result_string {x0y} |
| 6 |
stap_run2 $srcdir/$subdir/$test.stp -g |
| 7 |
|
| 8 |
set ::result_string {x1y} |
| 9 |
stap_run2 $srcdir/$subdir/$test.stp -g --skip-badvars |
| 10 |
|
| 11 |
# non-guru shouldn't be allowed to use @const (right at pass 1) |
| 12 |
set cmd [concat stap -p1 $srcdir/$subdir/$test.stp] |
| 13 |
set tst 0 |
| 14 |
eval spawn $cmd |
| 15 |
expect { |
| 16 |
-re {^parse error: using @const operator not permitted; need stap -g\r\n} |
| 17 |
{incr tst} |
| 18 |
-re {^[^\n\r]+\r\n} |
| 19 |
{exp_continue} |
| 20 |
} |
| 21 |
catch { close }; catch { wait } |
| 22 |
if {$tst == 1} { |
| 23 |
pass "$test (non-guru)" |
| 24 |
} else { |
| 25 |
fail "$test (non-guru)" |
| 26 |
} |
| 27 |
|