| 1 |
# Check that we can dereference a type declaration that is |
| 2 |
# defined in a separate CU from the function. |
| 3 |
set test "cu-decl" |
| 4 |
|
| 5 |
set script { |
| 6 |
probe process("cu-decl").function("print") { |
| 7 |
println($f->x * $f->y) |
| 8 |
} |
| 9 |
} |
| 10 |
|
| 11 |
set sources "$srcdir/$subdir/$test-1.c $srcdir/$subdir/$test-2.c" |
| 12 |
set flags "additional_flags=-g" |
| 13 |
for {set i 0} {$i < [all_compile_flags]} {incr i} { |
| 14 |
set extra_flag [all_compile_flag $i] |
| 15 |
set extra_name [all_compile_flag_name $i] |
| 16 |
|
| 17 |
set res [target_compile $sources $test executable "$flags $extra_flag"] |
| 18 |
if { $res != "" } { |
| 19 |
verbose "target_compile failed: $res" 2 |
| 20 |
fail "$test-$extra_name target compilation" |
| 21 |
untested "$test-$extra_name" |
| 22 |
} else { |
| 23 |
pass "$test-$extra_name target compilation" |
| 24 |
} |
| 25 |
foreach runtime [get_runtime_list] { |
| 26 |
if {$runtime != ""} { |
| 27 |
stap_compile $test-$extra_name-$runtime 1 "{$script}" \ |
| 28 |
--runtime=$runtime |
| 29 |
} elseif {[uprobes_p]} { |
| 30 |
stap_compile $test-$extra_name 1 "{$script}" |
| 31 |
} else { |
| 32 |
untested "$test-$extra_name" |
| 33 |
} |
| 34 |
} |
| 35 |
catch {exec rm $test} |
| 36 |
} |