| 1 |
set test "vta-test" |
| 2 |
set ::result_string {a: {17, 23} |
| 3 |
i: 0x6 |
| 4 |
a: {17, 23} |
| 5 |
i: 0xdeadbeef |
| 6 |
a: {17, 23} |
| 7 |
i: 0xdeadbeef87654321} |
| 8 |
|
| 9 |
proc dyninst_kfails {index} { |
| 10 |
# The dyninst runtime isn't multi-arch, it only works on the |
| 11 |
# native architecture. PR14490. |
| 12 |
if {! [all_compile_flag_native_p $index]} { |
| 13 |
setup_kfail 14490 "*-*-*" |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
for {set i 0} {$i < [all_compile_flags]} {incr i} { |
| 18 |
set extra_flag [all_compile_flag $i] |
| 19 |
set extra_name [all_compile_flag_name $i] |
| 20 |
verbose "testing vta-$extra_name" |
| 21 |
|
| 22 |
set test_flags "additional_flags=-g" |
| 23 |
set test_flags "$test_flags [sdt_includes]" |
| 24 |
set test_flags "$test_flags $extra_flag" |
| 25 |
|
| 26 |
set res [target_compile $srcdir/$subdir/$test.c $test-$extra_name.exe executable "$test_flags"] |
| 27 |
if { $res != "" } { |
| 28 |
verbose "target_compile $test-$extra_name failed: $res" 2 |
| 29 |
fail "$test.c compile $extra_name" |
| 30 |
untested "$test-$extra_name" |
| 31 |
continue |
| 32 |
} else { |
| 33 |
pass "$test.c compile $extra_name" |
| 34 |
} |
| 35 |
|
| 36 |
# Test only when we are running an install test (can execute) and |
| 37 |
# when gcc vta generated DW_OP_{stack|implicit}_values for us. See |
| 38 |
# PR10417. |
| 39 |
if {[installtest_p]} { |
| 40 |
# See if GCC produce DW_OP_implicit_value and/or |
| 41 |
# DW_OP_stack_value for us. |
| 42 |
set regexp {[stack|implicit]_value} |
| 43 |
if {![catch {exec readelf --debug-dump=loc $test-$extra_name.exe \ |
| 44 |
| grep -E "$regexp"}]} { |
| 45 |
foreach runtime [get_runtime_list] { |
| 46 |
if {$runtime != ""} { |
| 47 |
if { [info procs ${runtime}_kfails] ne "" } { |
| 48 |
${runtime}_kfails $i |
| 49 |
} |
| 50 |
stap_run3 $test-$extra_name-$runtime \ |
| 51 |
$srcdir/$subdir/$test.stp ./$test-$extra_name.exe \ |
| 52 |
-c ./$test-$extra_name.exe --runtime=$runtime |
| 53 |
} elseif {[uprobes_p]} { |
| 54 |
stap_run3 $test-$extra_name $srcdir/$subdir/$test.stp \ |
| 55 |
./$test-$extra_name.exe -c ./$test-$extra_name.exe |
| 56 |
} else { |
| 57 |
untested "$test-$extra_name" |
| 58 |
} |
| 59 |
} |
| 60 |
} else { |
| 61 |
untested "$test-$extra_name (no-gcc-vta)" |
| 62 |
} |
| 63 |
} else { |
| 64 |
untested "$test-$extra_name" |
| 65 |
} |
| 66 |
catch {exec rm -f $test-$extra_name.exe} |
| 67 |
} |