This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [vta->trunk] VTA merge
On Wed, Sep 02, 2009 at 07:17:25PM +0200, Jakub Jelinek wrote:
> And here is a more fancy one which also executes it and checks if global
> variable can be verified. Perhaps the first
> check_no_compiler_messages_nocache is redundant now and perhaps I should
> check that [string match "" $lines] is 1 before actually calling gcc_load
> on it.
Simplified version:
2009-09-02 Jakub Jelinek <jakub@redhat.com>
* 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.
--- gcc/testsuite/gcc.dg/guality/guality.exp.jj 2009-09-02 08:29:54.000000000 +0200
+++ gcc/testsuite/gcc.dg/guality/guality.exp 2009-09-02 19:37:49.000000000 +0200
@@ -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
Jakub