| 1 |
set test "tautological_cmp" |
| 2 |
set testpath "$srcdir/$subdir" |
| 3 |
|
| 4 |
if {! [installtest_p]} { untested "$test"; return } |
| 5 |
|
| 6 |
# --- TEST 1 --- |
| 7 |
|
| 8 |
set subtest1 "TEST 1: q == q" |
| 9 |
foreach runtime [get_runtime_list] { |
| 10 |
if {$runtime eq ""} { |
| 11 |
set runtime "kernel" |
| 12 |
} |
| 13 |
set test_name "$test: $subtest1 ($runtime)" |
| 14 |
|
| 15 |
set exit_code [run_cmd_2way "stap -e 'probe begin \{ a = 32; println (a == a); exit() \}' --runtime=$runtime" out stderr] |
| 16 |
|
| 17 |
set exp_out "1 |
| 18 |
" |
| 19 |
is "${test_name}: stdout" $out $exp_out |
| 20 |
|
| 21 |
is "${test_name}: exit code" $exit_code 0 |
| 22 |
|
| 23 |
set no_stderr_pat "-W(?:error=)?tautological-compare\\y" |
| 24 |
unlike "${test_name}: stderr" $stderr $no_stderr_pat "-linestop" |
| 25 |
} |
| 26 |
|
| 27 |
# --- TEST 2 --- |
| 28 |
|
| 29 |
set subtest2 "TEST 2: q != q" |
| 30 |
foreach runtime [get_runtime_list] { |
| 31 |
if {$runtime eq ""} { |
| 32 |
set runtime "kernel" |
| 33 |
} |
| 34 |
set test_name "$test: $subtest2 ($runtime)" |
| 35 |
|
| 36 |
set exit_code [run_cmd_2way "stap -e 'probe begin \{ a = 32; println (a != a); exit() \}' --runtime=$runtime" out stderr] |
| 37 |
|
| 38 |
set exp_out "0 |
| 39 |
" |
| 40 |
is "${test_name}: stdout" $out $exp_out |
| 41 |
|
| 42 |
is "${test_name}: exit code" $exit_code 0 |
| 43 |
|
| 44 |
set no_stderr_pat "-W(?:error=)?tautological-compare\\y" |
| 45 |
unlike "${test_name}: stderr" $stderr $no_stderr_pat "-linestop" |
| 46 |
} |