From patchwork Wed Aug 17 20:04:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [cxx-mem-model] handle xfails in the memmodel test harness From: Aldy Hernandez X-Patchwork-Id: 110346 Message-Id: <4E4C1EDF.9060602@redhat.com> To: Andrew MacLeod , gcc-patches Date: Wed, 17 Aug 2011 15:04:47 -0500 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. 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".