From 2e66901da2ffed2261784f458a2fc57d6f059725 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 17 Nov 2009 18:59:47 -0800 Subject: Test cross-CU type discovery Check that we can dereference a type declaration that is defined in a separate CU from the function. --- testsuite/systemtap.base/cu-decl.exp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 testsuite/systemtap.base/cu-decl.exp (limited to 'testsuite/systemtap.base/cu-decl.exp') diff --git a/testsuite/systemtap.base/cu-decl.exp b/testsuite/systemtap.base/cu-decl.exp new file mode 100644 index 00000000..42e683cb --- /dev/null +++ b/testsuite/systemtap.base/cu-decl.exp @@ -0,0 +1,23 @@ +# Check that we can dereference a type declaration that is +# defined in a separate CU from the function. +set test "cu-decl" + +set script { + probe process("cu-decl").function("print") { + println($f->x * $f->y) + } +} + +set sources "$srcdir/$subdir/$test-1.c $srcdir/$subdir/$test-2.c" +set res [target_compile $sources $test executable "additional_flags=-g"] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "$test target compilation" + untested "$test" +} else { + pass "$test target compilation" +} + +stap_compile $test 1 "{$script}" + +catch {exec rm $test} -- cgit From fad409cab6527b17dcc15a81505113606b8d4ed4 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 23 Nov 2009 16:38:04 +0800 Subject: Tweak cu-decl test * testsuite/systemtap.base/cu-decl.exp: Check utrace. * testsuite/lib/stap_compile.exp: Make catch after wait. --- testsuite/systemtap.base/cu-decl.exp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'testsuite/systemtap.base/cu-decl.exp') diff --git a/testsuite/systemtap.base/cu-decl.exp b/testsuite/systemtap.base/cu-decl.exp index 42e683cb..ae06ad85 100644 --- a/testsuite/systemtap.base/cu-decl.exp +++ b/testsuite/systemtap.base/cu-decl.exp @@ -17,7 +17,9 @@ if { $res != "" } { } else { pass "$test target compilation" } - -stap_compile $test 1 "{$script}" - +if {![utrace_p]} { + untested "$test : no kernel utrace support found" +} else { + stap_compile $test 1 "{$script}" +} catch {exec rm $test} -- cgit