From: Kaveh Ghazi Date: Wed, 30 Nov 2005 23:54:04 +0000 (+0000) Subject: backport: [multiple changes] X-Git-Tag: releases/gcc-3.4.5~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02213900f54d96d3eadc37b16dcce36d1fffff8c;p=thirdparty%2Fgcc.git backport: [multiple changes] 2005-11-30 Kaveh R. Ghazi Backport: 2005-01-05 Kaveh R. Ghazi * g++.old-deja/g++.pt/asm1.C, g++.old-deja/g++.pt/asm2.C, gcc.dg/20011119-1.c: Bypass tests on x86 when using -fpic/-fPIC. 2005-11-28 Kean Johnston * gcc.c-torture/compile/20000804-1.c: Skip if using -fPIC on X86. * gcc.dg/clobbers.c: Ditto. * gcc.dg/i386-cmov1.c: Make magic* static so it matches the test regexp. * gcc.dg/i386-mul.c: Ditto. * gcc.dg/i386-ssetype-1.c: Ditto. 2005-01-24 Janis Johnson * lib/gcc-dg.exp (dg-skip-if): New. From-SVN: r107744 --- diff --git a/gcc/testsuite/g++.old-deja/g++.pt/asm1.C b/gcc/testsuite/g++.old-deja/g++.pt/asm1.C index 24cf653ceb45..62787de9be18 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/asm1.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/asm1.C @@ -1,4 +1,6 @@ // { dg-do assemble { target i?86-*-linux* x86_64-*-linux* } } +// We'd use ebx with -fpic/-fPIC, so skip. +// { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } // Origin: "Weidmann, Nicholas" template int foo(int v) diff --git a/gcc/testsuite/g++.old-deja/g++.pt/asm2.C b/gcc/testsuite/g++.old-deja/g++.pt/asm2.C index b7e764808369..3fe5e2a213e3 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/asm2.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/asm2.C @@ -1,4 +1,6 @@ // { dg-do assemble { target i?86-*-linux* } } +// We'd use ebx with -fpic/-fPIC, so skip. +// { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } // Origin: "Weidmann, Nicholas" typedef void (function_ptr)(int); diff --git a/gcc/testsuite/gcc.c-torture/compile/20000804-1.c b/gcc/testsuite/gcc.c-torture/compile/20000804-1.c index 782764b31bb3..6942ae7c9ec7 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000804-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000804-1.c @@ -1,6 +1,7 @@ /* This does not work on m68hc11 or h8300 due to the use of an asm statement to force a 'long long' (64-bits) to go in a register. */ /* { dg-do assemble { xfail m6811-*-* m6812-*-* h8300-*-* } } */ +/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */ /* Copyright (C) 2000, 2003 Free Software Foundation */ __complex__ long long f () diff --git a/gcc/testsuite/gcc.dg/20011119-1.c b/gcc/testsuite/gcc.dg/20011119-1.c index 5b3c00cd36fa..28672eddde4b 100644 --- a/gcc/testsuite/gcc.dg/20011119-1.c +++ b/gcc/testsuite/gcc.dg/20011119-1.c @@ -1,5 +1,6 @@ /* Test for reload failing to eliminate from argp to sp. */ /* { dg-do run { target i?86-*-* } } */ +/* { dg-skip-if "" { i?86-*-* } { "-m64" "-fpic" "-fPIC" } { "" } } */ /* { dg-options "-O2 -fomit-frame-pointer" } */ static int ustrsize (const char *s); diff --git a/gcc/testsuite/gcc.dg/clobbers.c b/gcc/testsuite/gcc.dg/clobbers.c index 474a396a0519..5e312bcb95c2 100644 --- a/gcc/testsuite/gcc.dg/clobbers.c +++ b/gcc/testsuite/gcc.dg/clobbers.c @@ -1,6 +1,7 @@ /* Test asm clobbers on x86. */ /* { dg-do run { target i?86-*-* } } */ +/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/i386-cmov1.c b/gcc/testsuite/gcc.dg/i386-cmov1.c index 71f03ae9fead..9252d868f964 100644 --- a/gcc/testsuite/gcc.dg/i386-cmov1.c +++ b/gcc/testsuite/gcc.dg/i386-cmov1.c @@ -9,15 +9,15 @@ /* Check code generation for several conditional moves doable by single arithmetics. */ -int magic_namea; -char magic_nameb; -short magic_namec; -int magic_named; -char magic_namee; -short magic_namef; +static int magic_namea; +static char magic_nameb; +static short magic_namec; +static int magic_named; +static char magic_namee; +static short magic_namef; unsigned int gen; -m() +void m(void) { magic_namec=magic_namec>=0?0:-1; magic_namea=magic_namea>=0?0:-1; diff --git a/gcc/testsuite/gcc.dg/i386-mul.c b/gcc/testsuite/gcc.dg/i386-mul.c index 2a864af76d0d..72069fe2cf81 100644 --- a/gcc/testsuite/gcc.dg/i386-mul.c +++ b/gcc/testsuite/gcc.dg/i386-mul.c @@ -3,8 +3,8 @@ /* { dg-final { scan-assembler "and\[^\\n\]*magic" } } */ /* Should be done as "andw $32767, magic". */ -unsigned short magic; -t() +static unsigned short magic; +void t(void) { magic%=(unsigned short)0x8000U; } diff --git a/gcc/testsuite/gcc.dg/i386-ssetype-1.c b/gcc/testsuite/gcc.dg/i386-ssetype-1.c index 50d0fcaa58a8..47a68918d8ce 100644 --- a/gcc/testsuite/gcc.dg/i386-ssetype-1.c +++ b/gcc/testsuite/gcc.dg/i386-ssetype-1.c @@ -11,7 +11,7 @@ #include -__m128d magic_a, magic_b; +static __m128d magic_a, magic_b; __m128d t1(void) diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 8c01f2970550..32c0e998186a 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -359,6 +359,49 @@ proc dg-require-named-sections { args } { } } +# Skip the test (report it as UNSUPPORTED) if the target list and +# included flags are matched and the excluded flags are not matched. +# +# The first argument is the line number of the dg-skip-if directive +# within the test file. Remaining arguments are as for xfail lists: +# message { targets } { include } { exclude } +# +# This tests against multilib flags plus either the default flags for this +# group of tests or flags specified with a previous dg-options command. + +proc dg-skip-if { args } { + set args [lreplace $args 0 0] + + set selector "target [join [lindex $args 1]]" + if { [dg-process-target $selector] == "S" } { + # The target list matched; now check the flags. The DejaGnu proc + # check_conditional_xfail will look at the options in compiler_flags, + # so set that up for this test based on flags we know about. Start + # the list with a dummy tool name so the list will match "*" if + # there are no flags. + + global compiler_flags + upvar dg-extra-tool-flags extra_tool_flags + + set compiler_flags " toolname " + append compiler_flags $extra_tool_flags + set dest [target_info name] + if [board_info $dest exists multilib_flags] { + append compiler_flags "[board_info $dest multilib_flags] " + } + + # The target list might be an effective-target keyword, so replace + # the original list with "*-*-*". + if [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]] { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } + + # Any value in this variable was left over from an earlier test. + set compiler_flags "" + } +} + # Prune any messages matching ARGS[1] (a regexp) from test output. proc dg-prune-output { args } { global additional_prunes