From 19073ebc7ad340bcbcfc9e47715f235a53e0dc73 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 13 Jul 2011 18:31:56 +0200 Subject: [PATCH] g++.exp (g++_init): Use istarget. * lib/g++.exp (g++_init): Use istarget. Remove target_triplet global. * lib/obj-c++.exp (obj-c++_init): Ditto. * lib/file-format.exp (gcc_target_object_format): Ditto. * lib/target-supports-dg.exp (dg-require-dll): Ditto. * lib/target-supports-dg-exp (check_weak_available): Ditto. (check_visibility_available): Ditto. (check_effective_target_tls_native): Ditto. (check_effective_target_tls_emulated): Ditto. (check_effective_target_function_sections): Ditto. From-SVN: r176240 --- gcc/testsuite/ChangeLog | 23 +++++++--- gcc/testsuite/lib/file-format.exp | 7 ++- gcc/testsuite/lib/fortran-torture.exp | 22 ++++----- gcc/testsuite/lib/g++.exp | 3 +- gcc/testsuite/lib/gcc-defs.exp | 4 +- gcc/testsuite/lib/go-torture.exp | 8 ++-- gcc/testsuite/lib/obj-c++.exp | 5 +-- gcc/testsuite/lib/objc-torture.exp | 2 +- gcc/testsuite/lib/objc.exp | 2 +- gcc/testsuite/lib/scanasm.exp | 4 +- gcc/testsuite/lib/target-libpath.exp | 6 +-- gcc/testsuite/lib/target-supports-dg.exp | 5 +-- gcc/testsuite/lib/target-supports.exp | 57 +++++++++++------------- 13 files changed, 74 insertions(+), 74 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4febcdfb84f..a74ee65ae4c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2011-07-13 Uros Bizjak + + * lib/g++.exp (g++_init): Use istarget. Remove target_triplet global. + * lib/obj-c++.exp (obj-c++_init): Ditto. + * lib/file-format.exp (gcc_target_object_format): Ditto. + * lib/target-supports-dg.exp (dg-require-dll): Ditto. + * lib/target-supports-dg-exp (check_weak_available): Ditto. + (check_visibility_available): Ditto. + (check_effective_target_tls_native): Ditto. + (check_effective_target_tls_emulated): Ditto. + (check_effective_target_function_sections): Ditto. + 2011-07-13 Chung-Lin Tang * gcc.target/arm/pr48183.c: New test. @@ -35,12 +47,11 @@ 2011-07-11 H.J. Lu - * gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp: Check - ia32. + * gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp: Check ia32. * go.test/go-test.exp (go-set-goarch): Likewise. 2011-07-11 Georg-Johann Lay - + PR target/39633 * gcc.target/avr/torture/pr39633.c: New test case. @@ -50,7 +61,7 @@ * gfortran.dg/coarray_lock_3.f90: Remove bogus dg-error. 2011-07-11 Georg-Johann Lay - + * lib/target-supports.exp (check_effective_target_scheduling): New Function. * gcc.dg/pr46614.c: Add dg-require-effective-target scheduling. @@ -59,7 +70,7 @@ * g++.dg/pr45056.C: Ditto. 2011-07-11 Georg-Johann Lay - + * gcc.dg/compat/struct-by-value-16_main.c: Skip AVR. * gcc.dg/compat/struct-by-value-17_main.c: Skip AVR. * gcc.dg/compat/struct-by-value-18_main.c: Skip AVR. @@ -588,7 +599,7 @@ * gcc.dg/debug/pr49522.c: New test. 2011-07-07 Georg-Johann Lay - + * gcc.dg/pragma-align.c: Run only if target !default_packed. * gcc.dg/pr46212.c: Run only if target int32plus. * gcc.dg/torture/pr48146.c: Ditto. diff --git a/gcc/testsuite/lib/file-format.exp b/gcc/testsuite/lib/file-format.exp index 491cf1274d9..92437c4ef61 100644 --- a/gcc/testsuite/lib/file-format.exp +++ b/gcc/testsuite/lib/file-format.exp @@ -24,17 +24,16 @@ proc gcc_target_object_format { } { global gcc_target_object_format_saved - global target_triplet global tool if [info exists gcc_target_object_format_saved] { verbose "gcc_target_object_format returning saved $gcc_target_object_format_saved" 2 - } elseif { [string match "*-*-darwin*" $target_triplet] } { + } elseif { [istarget *-*-darwin*] } { # Darwin doesn't necessarily have objdump, so hand-code it. set gcc_target_object_format_saved mach-o - } elseif { [string match "hppa*-*-hpux*" $target_triplet] } { + } elseif { [istarget hppa*-*-hpux*] } { # HP-UX doesn't necessarily have objdump, so hand-code it. - if { [string match "hppa*64*-*-hpux*" $target_triplet] } { + if { [istarget hppa*64*-*-hpux*] } { set gcc_target_object_format_saved elf } else { set gcc_target_object_format_saved som diff --git a/gcc/testsuite/lib/fortran-torture.exp b/gcc/testsuite/lib/fortran-torture.exp index cd24ace426f..8d6e2ddd817 100644 --- a/gcc/testsuite/lib/fortran-torture.exp +++ b/gcc/testsuite/lib/fortran-torture.exp @@ -37,33 +37,33 @@ proc get-fortran-torture-options { } { set vectorizer_options [list "-O2" "-ftree-vectorize"] - if { [istarget "powerpc*-*-*"] + if { [istarget powerpc*-*-*] && [is-effective-target powerpc_altivec_ok] && [check_vmx_hw_available] } { lappend vectorizer_options "-maltivec" set test_tree_vectorize 1 - } elseif { [istarget "spu-*-*"] } { + } elseif { [istarget spu-*-*] } { set test_tree_vectorize 1 - } elseif { ( [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] ) + } elseif { ( [istarget i?86-*-*] || [istarget x86_64-*-*] ) && [check_effective_target_sse2] && [check_sse2_hw_available] && [check_sse_os_support_available] } { lappend vectorizer_options "-msse2" set test_tree_vectorize 1 - } elseif { [istarget "mips*-*-*"] + } elseif { [istarget mips*-*-*] && [check_effective_target_mpaired_single] && [check_effective_target_nomips16] } { lappend vectorizer_options "-mpaired-single" set test_tree_vectorize 1 - } elseif { [istarget "sparc*-*-*"] + } elseif { [istarget sparc*-*-*] && [check_effective_target_ultrasparc_hw] } { lappend vectorizer_options "-mcpu=ultrasparc" "-mvis" set test_tree_vectorize 1 - } elseif { [istarget "alpha*-*-*"] + } elseif { [istarget alpha*-*-*] && [check_alpha_max_hw_available] } { lappend vectorizer_options "-mmax" set test_tree_vectorize 1 - } elseif [istarget "ia64-*-*"] { + } elseif [istarget ia64-*-*] { set test_tree_vectorize 1 } else { set test_tree_vectorize 0 @@ -414,14 +414,14 @@ proc fortran-torture { args } { # proc add-ieee-options { } { # Ensure that excess precision does not cause problems. - if { [istarget "i?86-*-*"] - || [istarget "m68k-*-*"] } then { + if { [istarget i?86-*-*] + || [istarget m68k-*-*] } then { uplevel 1 lappend additional_flags "-ffloat-store" } # Enable full IEEE compliance mode. - if { [istarget "alpha*-*-*"] - || [istarget "sh*-*-*"] } then { + if { [istarget alpha*-*-*] + || [istarget sh*-*-*] } then { uplevel 1 lappend additional_flags "-mieee" } } diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 9de817b47f4..70c7aed4688 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -188,7 +188,6 @@ proc g++_init { args } { global TOOL_EXECUTABLE TOOL_OPTIONS global GXX_UNDER_TEST global TESTING_IN_BUILD_TREE - global target_triplet global gcc_warning_prefix global gcc_error_prefix @@ -263,7 +262,7 @@ proc g++_init { args } { set gcc_warning_prefix "warning:" set gcc_error_prefix "error:" - if { [string match "*-*-darwin*" $target_triplet] } { + if { [istarget *-*-darwin*] } { lappend ALWAYS_CXXFLAGS "ldflags=-multiply_defined suppress" } diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index f48520e46ab..0dbb088314f 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -157,8 +157,8 @@ proc ${tool}_check_unsupported_p { output } { if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] { return "memory full" } - if {[istarget spu-*-*] && \ - [string match "*exceeds local store*" $output]} { + if { [istarget spu-*-*] && \ + [string match "*exceeds local store*" $output] } { return "memory full" } return "" diff --git a/gcc/testsuite/lib/go-torture.exp b/gcc/testsuite/lib/go-torture.exp index 8c4be209b66..a956f3a7f92 100644 --- a/gcc/testsuite/lib/go-torture.exp +++ b/gcc/testsuite/lib/go-torture.exp @@ -356,14 +356,14 @@ proc go-torture { args } { # proc add-ieee-options { } { # Ensure that excess precision does not cause problems. - if { [istarget "i?86-*-*"] - || [istarget "m68k-*-*"] } then { + if { [istarget i?86-*-*] + || [istarget m68k-*-*] } then { uplevel 1 lappend additional_flags "-ffloat-store" } # Enable full IEEE compliance mode. - if { [istarget "alpha*-*-*"] - || [istarget "sh*-*-*"] } then { + if { [istarget alpha*-*-*] + || [istarget sh*-*-*] } then { uplevel 1 lappend additional_flags "-mieee" } } diff --git a/gcc/testsuite/lib/obj-c++.exp b/gcc/testsuite/lib/obj-c++.exp index 57bab524a32..b3bed0e30a2 100644 --- a/gcc/testsuite/lib/obj-c++.exp +++ b/gcc/testsuite/lib/obj-c++.exp @@ -210,7 +210,6 @@ proc obj-c++_init { args } { global TOOL_EXECUTABLE TOOL_OPTIONS global OBJCXX_UNDER_TEST global TESTING_IN_BUILD_TREE - global target_triplet global gcc_warning_prefix global gcc_error_prefix @@ -270,7 +269,7 @@ proc obj-c++_init { args } { set gcc_warning_prefix "warning:" set gcc_error_prefix "error:" - if { [string match "*-*-darwin*" $target_triplet] } { + if { [istarget *-*-darwin*] } { lappend ALWAYS_OBJCXXFLAGS "ldflags=-multiply_defined suppress" } @@ -299,7 +298,7 @@ proc obj-c++_target_compile { source dest type options } { # we need to add the include path for the gnu runtime if that is in # use. # First, set the default... - if { [istarget "*-*-darwin*"] } { + if { [istarget *-*-darwin*] } { set nextruntime 1 } else { set nextruntime 0 diff --git a/gcc/testsuite/lib/objc-torture.exp b/gcc/testsuite/lib/objc-torture.exp index 6c21a5fa5ec..357ab76398c 100644 --- a/gcc/testsuite/lib/objc-torture.exp +++ b/gcc/testsuite/lib/objc-torture.exp @@ -30,7 +30,7 @@ proc objc-set-runtime-options { dowhat args } { # installation can have the objc headers present in the same locations # that Darwin uses. If NeXT is ported to another target, then it should # be listed here. - if [istarget "*-*-darwin*" ] { + if [istarget *-*-darwin*] { lappend rtlist "-fnext-runtime" } if [info exists OBJC_RUNTIME_OPTIONS] { diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp index ae0671f9e19..3a19c48f278 100644 --- a/gcc/testsuite/lib/objc.exp +++ b/gcc/testsuite/lib/objc.exp @@ -150,7 +150,7 @@ proc objc_target_compile { source dest type options } { # we need to add the include path for the gnu runtime if that is in # use. # First set the default... - if { [istarget "*-*-darwin*"] } { + if { [istarget *-*-darwin*] } { set nextruntime 1 } else { set nextruntime 0 diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 73eb396b2c3..6574ab13a35 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -461,10 +461,10 @@ proc dg-function-on-line { args } { } } - if { [istarget "hppa*-*-*"] } { + if { [istarget hppa*-*-*] } { set pattern [format {\t;[^:]+:%d\n(\t[^\t]+\n)+%s:\n\t.PROC} \ $line $symbol] - } elseif { [istarget "mips-sgi-irix*"] } { + } elseif { [istarget mips-sgi-irix*] } { set pattern [format {\t\.loc [0-9]+ %d 0( [^\n]*)?\n\t\.set\t(no)?mips16\n\t\.ent\t%s\n\t\.type\t%s, @function\n%s:\n} \ $line $symbol $symbol $symbol] } else { diff --git a/gcc/testsuite/lib/target-libpath.exp b/gcc/testsuite/lib/target-libpath.exp index 6a01d9498e7..d3d743810f0 100644 --- a/gcc/testsuite/lib/target-libpath.exp +++ b/gcc/testsuite/lib/target-libpath.exp @@ -272,11 +272,11 @@ proc restore_ld_library_path_env_vars { } { proc get_shlib_extension { } { global shlib_ext - if { [ istarget *-*-darwin* ] } { + if { [istarget *-*-darwin*] } { set shlib_ext "dylib" - } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-mingw* ] } { + } elseif { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { set shlib_ext "dll" - } elseif { [ istarget hppa*-*-hpux* ] } { + } elseif { [istarget hppa*-*-hpux*] } { set shlib_ext "sl" } else { set shlib_ext "so" diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index 68e250ba872..3e577a91166 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -122,11 +122,10 @@ proc dg-require-profiling { args } { # If this target does not support DLL attributes skip this test. proc dg-require-dll { args } { - global target_triplet # As a special case, the mcore-*-elf supports these attributes. # All Symbian OS targets also support these attributes. - if { [string match "mcore-*-elf" $target_triplet] - || [string match "*-*-symbianelf" $target_triplet]} { + if { [istarget mcore-*-elf] + || [istarget *-*-symbianelf] } { return } # PE/COFF targets support dllimport/dllexport. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index cf44f1e3675..e981608cc39 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -219,7 +219,6 @@ proc check_runtime {prop args} { # this proc returns 1 if they're supported, 0 if they're not, or -1 if unsure proc check_weak_available { } { - global target_triplet global target_cpu # All mips targets should support it @@ -230,25 +229,25 @@ proc check_weak_available { } { # All solaris2 targets should support it - if { [regexp ".*-solaris2.*" $target_triplet] } { + if { [istarget *-*-solaris2*] } { return 1 } # DEC OSF/1/Digital UNIX/Tru64 UNIX supports it - if { [regexp "alpha.*osf.*" $target_triplet] } { + if { [istarget alpha*-dec-osf*] } { return 1 } # Windows targets Cygwin and MingW32 support it - if { [regexp ".*mingw32|.*cygwin" $target_triplet] } { + if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { return 1 } # HP-UX 10.X doesn't support it - if { [istarget "hppa*-*-hpux10*"] } { + if { [istarget hppa*-*-hpux10*] } { return 0 } @@ -276,7 +275,7 @@ proc check_weak_available { } { # cannot be overridden. proc check_weak_override_available { } { - if { [istarget "*-*-mingw*"] } { + if { [istarget *-*-mingw*] } { return 0 } return [check_weak_available] @@ -291,9 +290,6 @@ proc check_weak_override_available { } { # The argument is the kind of visibility, default/protected/hidden/internal. proc check_visibility_available { what_kind } { - global tool - global target_triplet - # On NetWare, support makes no sense. if { [istarget *-*-netware*] } { return 0 @@ -627,7 +623,7 @@ proc check_effective_target_pcc_bitfield_type_matters { } { proc add_options_for_tls { flags } { # Tru64 UNIX uses emutls, which relies on a couple of pthread functions # which only live in libpthread, so always pass -pthread for TLS. - if { [istarget *-*-osf*] } { + if { [istarget alpha*-dec-osf*] } { return "$flags -pthread" } # On Solaris 8 and 9, __tls_get_addr/___tls_get_addr only lives in @@ -660,8 +656,7 @@ proc check_effective_target_tls {} { proc check_effective_target_tls_native {} { # VxWorks uses emulated TLS machinery, but with non-standard helper # functions, so we fail to automatically detect it. - global target_triplet - if { [regexp ".*-.*-vxworks.*" $target_triplet] } { + if { [istarget *-*-vxworks*] } { return 0 } @@ -677,8 +672,7 @@ proc check_effective_target_tls_native {} { proc check_effective_target_tls_emulated {} { # VxWorks uses emulated TLS machinery, but with non-standard helper # functions, so we fail to automatically detect it. - global target_triplet - if { [regexp ".*-.*-vxworks.*" $target_triplet] } { + if { [istarget *-*-vxworks*] } { return 1 } @@ -702,8 +696,7 @@ proc check_effective_target_tls_runtime {} { proc check_effective_target_function_sections {} { # Darwin has its own scheme and silently accepts -ffunction-sections. - global target_triplet - if { [regexp ".*-.*-darwin.*" $target_triplet] } { + if { [istarget *-*-darwin*] } { return 0 } @@ -1435,7 +1428,7 @@ proc check_fork_available {} { # Returns true iff "mkfifo" is available on the target system. proc check_mkfifo_available {} { - if {[istarget *-*-cygwin*]} { + if { [istarget *-*-cygwin*] } { # Cygwin has mkfifo, but support is incomplete. return 0 } @@ -1447,10 +1440,10 @@ proc check_mkfifo_available {} { proc check_cxa_atexit_available { } { return [check_cached_effective_target cxa_atexit_available { - if { [istarget "hppa*-*-hpux10*"] } { + if { [istarget hppa*-*-hpux10*] } { # HP-UX 10 doesn't have __cxa_atexit but subsequent test passes. expr 0 - } elseif { [istarget "*-*-vxworks"] } { + } elseif { [istarget *-*-vxworks] } { # vxworks doesn't have __cxa_atexit but subsequent test passes. expr 0 } else { @@ -2282,7 +2275,7 @@ proc check_effective_target_powerpc_ppu_ok { } { # Return 1 if this is a PowerPC target that supports SPU. proc check_effective_target_powerpc_spu { } { - if [istarget powerpc*-*-linux*] { + if { [istarget powerpc*-*-linux*] } { return [check_effective_target_powerpc_altivec_ok] } else { return 0 @@ -3705,11 +3698,11 @@ proc add_options_for_c99_runtime { flags } { # full IEEE compliance mode. proc add_options_for_ieee { flags } { - if { [istarget "alpha*-*-*"] - || [istarget "sh*-*-*"] } { + if { [istarget alpha*-*-*] + || [istarget sh*-*-*] } { return "$flags -mieee" } - if { [istarget "rx-*-*"] } { + if { [istarget rx-*-*] } { return "$flags -mnofpu" } return $flags @@ -3999,21 +3992,21 @@ proc check_vect_support_and_set_flags { } { global DEFAULT_VECTCFLAGS global dg-do-what-default - if [istarget "powerpc-*paired*"] { + if [istarget powerpc-*paired*] { lappend DEFAULT_VECTCFLAGS "-mpaired" if [check_750cl_hw_available] { set dg-do-what-default run } else { set dg-do-what-default compile } - } elseif [istarget "powerpc*-*-*"] { + } elseif [istarget powerpc*-*-*] { # Skip targets not supporting -maltivec. if ![is-effective-target powerpc_altivec_ok] { return 0 } lappend DEFAULT_VECTCFLAGS "-maltivec" - if [check_vsx_hw_available] { + if [check_vsx_hw_available] { lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign" } @@ -4026,16 +4019,16 @@ proc check_vect_support_and_set_flags { } { } set dg-do-what-default compile } - } elseif { [istarget "spu-*-*"] } { + } elseif { [istarget spu-*-*] } { set dg-do-what-default run - } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } { + } elseif { [istarget i?86-*-*] || [istarget x86_64-*-*] } { lappend DEFAULT_VECTCFLAGS "-msse2" if { [check_effective_target_sse2_runtime] } { set dg-do-what-default run } else { set dg-do-what-default compile } - } elseif { [istarget "mips*-*-*"] + } elseif { [istarget mips*-*-*] && ([check_effective_target_mpaired_single] || [check_effective_target_mips_loongson]) && [check_effective_target_nomips16] } { @@ -4043,14 +4036,14 @@ proc check_vect_support_and_set_flags { } { lappend DEFAULT_VECTCFLAGS "-mpaired-single" } set dg-do-what-default run - } elseif [istarget "sparc*-*-*"] { + } elseif [istarget sparc*-*-*] { lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis" if [check_effective_target_ultrasparc_hw] { set dg-do-what-default run } else { set dg-do-what-default compile } - } elseif [istarget "alpha*-*-*"] { + } elseif [istarget alpha*-*-*] { # Alpha's vectorization capabilities are extremely limited. # It's more effort than its worth disabling all of the tests # that it cannot pass. But if you actually want to see what @@ -4063,7 +4056,7 @@ proc check_vect_support_and_set_flags { } { } else { set dg-do-what-default compile } - } elseif [istarget "ia64-*-*"] { + } elseif [istarget ia64-*-*] { set dg-do-what-default run } elseif [is-effective-target arm_neon_ok] { eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""] -- 2.30.2