Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/at_var_void_stmt.exp

raw
1 set test "at_var_void_stmt"
2 set testpath "$srcdir/$subdir"
3
4 # Check the void statement reducer with @var.
5 set output_string ".*?enter func sub\r\n"
6
7 # Only run on make installcheck and uprobes present.
8 if {! [installtest_p]} { untested "$test"; return }
9 if {! [uprobes_p]} { untested "$test"; return }
10
11 set res [target_compile ${testpath}/$test.c $test executable \
12 "additional_flags=-O2 additional_flags=-g"]
13
14 if { $res != "" } {
15 verbose "target_compile failed: $res" 2
16 fail "unable to compile ${test}.c"
17 }
18
19 spawn stap --vp 03 $srcdir/$subdir/$test.stp -c ./$test $test
20 set ok 0
21 set logs 0
22
23 expect {
24 -timeout 180
25
26 -re {^Eliding unused target symbol operator '@var'} {
27 incr logs; exp_continue
28 }
29
30 -re {^Eliding side-effect-free singleton block operator '@var'} {
31 incr logs; exp_continue
32 }
33
34 -re {^count = 3\r\n} { incr ok; exp_continue; }
35
36 -re {^[^\r\n]*\r\n} { exp_continue }
37
38 timeout { fail "$test (timeout)" }
39 eof { }
40 }
41 catch { close }; catch { wait }
42
43 if {$ok == 1 && $logs == 2} {
44 pass "$test ($ok, $logs)"
45 } {
46 fail "$test ($ok, $logs)"
47 }
48
49 # Cleanup
50 if { $verbose == 0 } { catch { exec rm -f $test } }