| 1 |
# Testcase for PR14107 missing kernel ASM CFI. |
| 2 |
set test "bad-code" |
| 3 |
set testpath "$srcdir/$subdir" |
| 4 |
|
| 5 |
set output_string {0x[\\da-f]+ : func+[^\\r\\n]+\r\n0x[\\da-f]+ : main+[^\\r\\n]+\r\n} |
| 6 |
|
| 7 |
# Note don't optimize we are really interested in the non-inlined case |
| 8 |
set test_flags "additional_flags=-g" |
| 9 |
|
| 10 |
set res [target_compile $srcdir/$subdir/$test.c $test executable "$test_flags"] |
| 11 |
if { $res != "" } { |
| 12 |
verbose "target_compile $test failed: $res" 2 |
| 13 |
fail "$test.c compile" |
| 14 |
untested "$test" |
| 15 |
continue |
| 16 |
} else { |
| 17 |
pass "$test.c compile" |
| 18 |
|
| 19 |
if {[installtest_p]} { |
| 20 |
set main 0 |
| 21 |
set func 0 |
| 22 |
send_log "Running: stap ${testpath}/${test}.stp -w -d ./$test -c ./$test\n" |
| 23 |
|
| 24 |
spawn stap ${testpath}/${test}.stp -w -d ./$test -c ./$test |
| 25 |
expect { |
| 26 |
-timeout 60 |
| 27 |
-re {^ 0x[a-f0-9]+ : func\+0x[^\r\n]+\r\n} {incr func; exp_continue} |
| 28 |
-re {^ 0x[a-f0-9]+ : main\+0x[^\r\n]+\r\n} {incr main; exp_continue} |
| 29 |
timeout { fail "$test (timeout)"; kill -INT -[exp_pid] } |
| 30 |
eof { } |
| 31 |
} |
| 32 |
|
| 33 |
kill -INT -[exp_pid] 2 |
| 34 |
catch {close}; catch {wait} |
| 35 |
|
| 36 |
send_log "main: $main, func: $func\n" |
| 37 |
|
| 38 |
if {[istarget s390x-*-*]} {setup_kfail S390X [istarget]} |
| 39 |
|
| 40 |
if {$main == 1 && $func == 1} {pass "$test"} {fail "$test"} |
| 41 |
} else { |
| 42 |
untested "$test" |
| 43 |
} |
| 44 |
} |