File: bad-code.exp

package info (click to toggle)
systemtap 5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,556 kB
  • sloc: cpp: 81,117; ansic: 54,933; xml: 49,795; exp: 43,595; sh: 11,526; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (44 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Testcase for PR14107 missing kernel ASM CFI.
set test "bad-code"
set testpath "$srcdir/$subdir"

set output_string {0x[\\da-f]+ : func+[^\\r\\n]+\r\n0x[\\da-f]+ : main+[^\\r\\n]+\r\n}

# Note don't optimize we are really interested in the non-inlined case
set test_flags "additional_flags=-g"

set res [target_compile $srcdir/$subdir/$test.c $test executable "$test_flags"]
if { $res != "" } {
  verbose "target_compile $test failed: $res" 2
  fail "$test.c compile"
  untested "$test"
  continue
} else {
  pass "$test.c compile"

  if {[installtest_p]} {
    set main 0
    set func 0
    send_log "Running: stap ${testpath}/${test}.stp -w -d ./$test -c ./$test\n"

    spawn stap ${testpath}/${test}.stp -w -d ./$test -c ./$test
    expect {
      -timeout 60
      -re {^ 0x[a-f0-9]+ : func\+0x[^\r\n]+\r\n} {incr func; exp_continue}
      -re {^ 0x[a-f0-9]+ : main\+0x[^\r\n]+\r\n} {incr main; exp_continue}
      timeout { fail "$test (timeout)"; kill -INT -[exp_pid] }
      eof { }
    }

    kill -INT -[exp_pid] 2
    catch {close}; catch {wait}

    send_log "main: $main, func: $func\n"

    if {[istarget s390x-*-*]} {setup_kfail S390X [istarget]}

    if {$main == 1 && $func == 1} {pass "$test"} {fail "$test"}
  } else {
    untested "$test"
  }
}