summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/vta-test.exp
blob: d85a70b89c4c3a670f685744656afb32dd4a0f0b (plain)
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
set test "vta-test"
set ::result_string {i: 0x6
i: 0xdeadbeef
i: 0xdeadbeef87654321}

set test_flags "additional_flags=-g"
set test_flags "$test_flags additional_flags=-O2"
set test_flags "$test_flags additional_flags=-I$srcdir/../includes"

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

# Test only when we are running an install test (can execute) and when gcc
# vta generated DW_OP_{stack|implicit}_values for us. See PR10417.
if {[installtest_p] && [uprobes_p]} {
  # See if GCC produce DW_OP_implicit_value and/or DW_OP_stack_value for us.
  set regexp {[stack|implicit]_value}
  if {![catch {exec readelf --debug-dump=loc vta-test.exe | egrep "$regexp"}]} {
    stap_run2 $srcdir/$subdir/$test.stp -c ./$test.exe
  } {
    untested "$test (no-gcc-vta)"
  }
} else {
  untested "$test"
}
catch {exec rm -f $test.exe}