Patchwork [cxx-mem-model] handle xfails in the memmodel test harness

login
register
mail settings
Submitter Aldy Hernandez
Date Aug. 17, 2011, 8:04 p.m.
Message ID <4E4C1EDF.9060602@redhat.com>
Download mbox | patch
Permalink /patch/110346/
State New
Headers show

Comments

Aldy Hernandez - Aug. 17, 2011, 8:04 p.m.
With this patch we can now XFAIL tests that are expected to fail at 
runtime.  This is how it's used:

/* { dg-final { memmodel-gdb-test { xfail x86*-*-* } } } */

Note, that the test will still run.

This is needed for an upcoming known-to-fail test Andrew will contribute 
shortly.

Committed to branch.

        * lib/gcc-memmodel-gdb-test.exp (memmmodel-gdb-test): Handle

      # A cleaner solution would require a new DejaGnu release.

Patch

Index: lib/gcc-memmodel-gdb-test.exp
===================================================================
--- lib/gcc-memmodel-gdb-test.exp       (revision 177836)
+++ lib/gcc-memmodel-gdb-test.exp       (working copy)
@@ -21,9 +21,15 @@ 
  #
  # Call 'fail' if a given test printed "FAIL:", otherwise call 'pass'.

-proc memmodel-gdb-test { } {
+proc memmodel-gdb-test { args } {
      if { ![isnative] || [is_remote target] } { return }

+    if { [llength $args] == 1 } {
+       switch [dg-process-target [lindex $args 0]] {
+               "F" { setup_xfail "*-*-*" }
+       }
+    }
+
      # This assumes that we are three frames down from dg-test, and that
      # it still stores the filename of the testcase in a local variable 
"name".