This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[testsuite] fix testsuite/41659, target or xfail with dg-lto-do
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Oct 2009 10:19:57 -0700
- Subject: [testsuite] fix testsuite/41659, target or xfail with dg-lto-do
- Reply-to: janis187 at us dot ibm dot com
The test directive dg-lto-do does not support target and xfail causes
and ignores them. That behavior is documented in the section on LTO
testing in the GCC internals manual, but there was no warning or error
about it. This patch fixes a test that tries to skip a test with a
"target" clause and reports an error for using "target" or "xfail" with
that directive.
Tested on powerpc64-linux by running lto.exp for c,c++,fortran, checked
in on trunk.
2009-10-12 Janis Johnson <janis187@us.ibm.com>
PR testsuite/41659
* gcc.dg/lto/20090914-2.c: Use dg-skip-if to skip test.
* lib/lto.exp (lto-get-options-main): Report error for using "target"
or "xfail" with dg-lto-dg.
Index: gcc/testsuite/gcc.dg/lto/20090914-2_0.c
===================================================================
--- gcc/testsuite/gcc.dg/lto/20090914-2_0.c (revision 152593)
+++ gcc/testsuite/gcc.dg/lto/20090914-2_0.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-lto-do run { target x86_64-*-* i?86-*-* } } */
+/* { dg-lto-do run */
+/* { dg-skip-if "x86 only" { ! { x86_64-*-* i?86-*-* } } { "*" } { "" } }
/* Doesn't work without this dummy function with -fwhopr. */
int foo(void) { }
Index: gcc/testsuite/lib/lto.exp
===================================================================
--- gcc/testsuite/lib/lto.exp (revision 152593)
+++ gcc/testsuite/lib/lto.exp (working copy)
@@ -191,6 +191,16 @@ proc lto-get-options-main { src } {
|| ![string compare "dg-options" $cmd] } {
warning "lto.exp does not support $cmd in primary source file"
} elseif { ![string compare "dg-lto-do" $cmd] } {
+ if { [llength $op] > 3 } {
+ set kw [lindex [lindex $op 3] 0]
+ if [string match "target" $kw] {
+ perror "$src: dg-lto-do does not support \"target\""
+ } elseif [string match "xfail" $kw] {
+ perror "$src: dg-lto-do does not support \"xfail\""
+ } else {
+ perror "$src: dg-lto-do takes a single argument"
+ }
+ }
set dgdo [lindex $op 2]
verbose "dg-lto-do command for \"$op\" is $dgdo"
if { ![string compare "assemble" $dgdo] } {