Debian Codegraph @

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

raw
1 set test "at_var_unresolved_lvalue"
2 set testpath "$srcdir/$subdir"
3
4 # Check unresolved @var used as lvalue.
5
6 # Only run on make installcheck and uprobes present.
7 if {! [installtest_p]} { untested "$test"; return }
8 if {! [uprobes_p]} { untested "$test"; return }
9
10 set res [target_compile ${testpath}/at_var.c $test executable \
11 "additional_flags=-O2 additional_flags=-g"]
12
13 if { $res != "" } {
14 verbose "target_compile failed: $res" 2
15 fail "unable to compile ${test}.c"
16 }
17
18 spawn stap $srcdir/$subdir/$test.stp -c ./$test $test -g
19 set ok 0
20
21 expect {
22 -timeout 180
23
24 -re {^semantic error: unable to find global 'no_such_variable' in at_var_unresolved_lvalue} {
25 incr ok; exp_continue
26 }
27
28 -re {^[^\r\n]*\r\n} { exp_continue }
29
30 timeout { fail "$test (timeout)" }
31 eof { }
32 }
33 catch { close }; catch { wait }
34
35 if {$ok == 1} {
36 pass "$test"
37 } {
38 fail "$test"
39 }
40
41 # Cleanup
42 if { $verbose == 0 } { catch { exec rm -f $test } }