guality.exp: Only run guality tests if a trivial testcase using guality.h compiles...
authorJakub Jelinek <jakub@redhat.com>
Fri, 4 Sep 2009 06:56:55 +0000 (08:56 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 4 Sep 2009 06:56:55 +0000 (08:56 +0200)
* 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
gcc/testsuite/gcc.dg/guality/guality.exp

index 1317b16..f9e2502 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-03  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.
+
 2009-09-03  Bernd Schmidt  <bernd.schmidt@analog.com>
 
        * lib/target-supports.exp (check_effective_target_sync_int_long):
index b151c2e..15a6e5e 100644 (file)
@@ -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