Debian Codegraph @

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

raw
1 set test pr30407
2
3 proc test_cleanup {} {
4 catch {exec rm -f $test}
5 }
6
7 if {! [installtest_p] || ! [uretprobes_p]} {
8 test_cleanup
9 untested "$test -p5"
10 return
11 }
12
13 for {set i 0} {$i < [arch_compile_flags]} {incr i} {
14 for {set d 4} {$d <=5} {incr d} {
15 foreach j { \ PIE } {
16 set test_flags "compiler=gcc [arch_compile_flag $i]"
17 set test_flags "$test_flags additional_flags=-g additional_flags=-gdwarf-$d"
18 if { $j == "PIE" } {
19 set test_flags "$test_flags additional_flags=-fPIE"
20 set test_flags "$test_flags additional_flags=-pie"
21 }
22 set res [target_compile $srcdir/$subdir/$test.c $test \
23 executable $test_flags]
24 if {$res == "" && [file exists $test]} then {
25 pass "$test compile ($test_flags)"
26 } else {
27 fail "$test compile ($test_flags)"
28 }
29
30 spawn stap --ldd $srcdir/$subdir/$test.stp -c ./$test
31 set ok 0
32 expect {
33 -timeout 60
34 -re {[\ ]*0x[0-9a-f]+[^\r\n]*systemtap.base/pr30407.c:[0-9][^\r\n]*\r\n} {
35 incr ok; exp_continue
36 }
37 -re {[\ ]*0x[0-9a-f]+[^\r\n]*\r\n} { exp_continue }
38 timeout { fail "$test (timeout)" }
39 eof { }
40 }
41 catch { close }; catch { wait }
42 if {$ok == 1} then {
43 pass "$test -p5 ($test_flags - $ok)"
44 } else {
45 fail "$test -p5 ($test_flags - $ok)"
46 }
47 }
48 }
49 }
50 test_cleanup