| 1 |
set test "sdt_casm" |
| 2 |
|
| 3 |
# Test SDT in C-asm with STAP_PROBE_ASM, with and without asm operands. |
| 4 |
# |
| 5 |
# An attempted fix for PR13974 had broken STAP_PROBE_ASM, because in that case |
| 6 |
# there's some ambiguity whether %note and %progbits should be %%-escaped. We |
| 7 |
# can't determine that in general, because it depends on whether the user's |
| 8 |
# asm() has operands. That fix was thus reverted, and we're testing to make |
| 9 |
# sure STAP_PROBE_ASM doesn't regress again. |
| 10 |
|
| 11 |
if {! [installtest_p]} { untested "$test"; return } |
| 12 |
|
| 13 |
proc cleanup_handler { verbose } { |
| 14 |
if { $verbose == 0 } { |
| 15 |
catch {exec rm -f sdt_casm.x} |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
set script $srcdir/$subdir/$test.stp |
| 20 |
set ::result_string {PASS: probe0 |
| 21 |
PASS: probe1 |
| 22 |
PASS: probe2} |
| 23 |
|
| 24 |
set asm_flags [sdt_includes] |
| 25 |
set asm_flags "$asm_flags additional_flags=-std=c99" |
| 26 |
set res [target_compile $srcdir/$subdir/sdt_casm.c sdt_casm.x \ |
| 27 |
executable $asm_flags] |
| 28 |
if { $res != "" } { |
| 29 |
verbose "target_compile failed: $res" 2 |
| 30 |
fail "$test compiling sdt_casm.c" |
| 31 |
} else { |
| 32 |
pass "$test compiling sdt_casm.c" |
| 33 |
} |
| 34 |
|
| 35 |
foreach runtime [get_runtime_list] { |
| 36 |
if {$runtime != ""} { |
| 37 |
stap_run3 "$test ($runtime)" $script --runtime=$runtime -c sdt_casm.x |
| 38 |
} elseif {[uprobes_p]} { |
| 39 |
stap_run3 $test $script -c ./sdt_casm.x |
| 40 |
} else { |
| 41 |
untested "$test" |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
cleanup_handler $verbose |