Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/cast-scope.exp

raw
1 set test "cast-scope"
2 set ::result_string {function direct: {._str="Hello World!", ._l=12}
3 function cast: {._str="Hello World!", ._l=12}
4 mark cast: {._str="Hello World!", ._l=12}
5 statement direct: {._str="Hello World!", ._l=12}
6 statement cast: {._str="Hello World!", ._l=12}}
7
8 set srcfile "$srcdir/$subdir/$test.cxx"
9 set stpfile "$srcdir/$subdir/$test.stp"
10
11 proc dyninst_kfails {index} {
12
13 # The dyninst runtime isn't multi-arch, it only works on the
14 # native architecture. PR14490.
15 if {! [all_compile_flag_native_p $index]} {
16 setup_kfail 14490 "*-*-*"
17 }
18
19 # On ppc, stapdyn does not retrieve all registers, causing
20 # various failures (such as the inability to retrieve DWARF
21 # vars in unoptimized code). PR15614.
22 if {[string match ppc* $::tcl_platform(machine)] && \
23 ![all_compile_flag_optimized_p $index]} {
24 setup_kfail 15614 "*-*-*"
25 }
26 }
27
28 foreach dialect {"" "-std=c++98" "-std=c++03" "-std=c++11" "-std=c++14" "-std=c++17" "-std=c++20" "-std=c++23"} {
29 for {set i 0} {$i < [all_compile_flags]} {incr i} {
30 set extra_flag "[all_compile_flag $i] additional_flags=$dialect"
31 set extra_name "[all_compile_flag_name $i]-$dialect"
32 set test_flags "compiler=g++ additional_flags=-g [sdt_includes] $extra_flag"
33 verbose -log "using $test_flags"
34 set res [target_compile "$srcfile" $test-$extra_name.exe \
35 executable "$test_flags"]
36 if { $res != "" } {
37 verbose "target_compile failed: $res" 2
38 fail "$test-$extra_name compile"
39 untested "$test-$extra_name"
40 continue
41 } else {
42 pass "$test-$extra_name compile"
43 }
44
45 catch {exec readelf -w $test-$extra_name.exe | grep "DW_AT_language.*:"} output
46 verbose -log "$output"
47
48 if {[installtest_p]} {
49 foreach runtime [get_runtime_list] {
50 if {$runtime != ""} {
51 if {[info procs ${runtime}_kfails] ne ""} {
52 ${runtime}_kfails $i
53 }
54 stap_run3 "$test-$extra_name-$runtime" "$stpfile" \
55 -c "./$test-$extra_name.exe 'Hello World!'" --runtime=$runtime
56 } elseif {[uprobes_p]} {
57 stap_run3 "$test-$extra_name" "$stpfile" \
58 -c "./$test-$extra_name.exe 'Hello World!'"
59 } else {
60 untested "$test-$extra_name"
61 }
62 }
63 } else {
64 untested "$test-$extra_name"
65 }
66 catch {exec rm -f $test-$extra_name.exe}
67 }
68 }