From 4d17b2f6959ed19d8d5d3f2f52e8e539cec980c7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 4 Sep 2009 08:56:55 +0200 Subject: [PATCH] guality.exp: Only run guality tests if a trivial testcase using guality.h compiles and links... * gcc.dg/guality/guality.exp: Only run guality tests if a trivial testcase using guality.h compiles and links and if a global variable can be verified by gdb. From-SVN: r151410 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/guality/guality.exp | 26 +++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1317b16d5e7..f9e250297be 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-09-03 Jakub Jelinek + + * gcc.dg/guality/guality.exp: Only run guality tests if a trivial + testcase using guality.h compiles and links and if a global variable + can be verified by gdb. + 2009-09-03 Bernd Schmidt * lib/target-supports.exp (check_effective_target_sync_int_long): diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp index b151c2e0772..15a6e5e6342 100644 --- a/gcc/testsuite/gcc.dg/guality/guality.exp +++ b/gcc/testsuite/gcc.dg/guality/guality.exp @@ -2,6 +2,30 @@ load_lib gcc-dg.exp +proc check_guality {args} { + set result [eval check_compile guality_check executable $args "-g -O0"] + set lines [lindex $result 0] + set output [lindex $result 1] + set ret 0 + if {[string match "" $lines]} { + set execout [gcc_load "./$output"] + set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout] + } + remote_file build delete $output + return $ret +} + dg-init -gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "" + +if {[check_guality " + #include \"$srcdir/$subdir/guality.h\" + volatile long int varl = 6; + int main (int argc, char *argv\[\]) + { + GUALCHKVAL (varl); + return 0; + } +"]} { + gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "" +} dg-finish