summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2010-11-22 22:49:19 +0100
committerUros Bizjak <uros@gcc.gnu.org>2010-11-22 22:49:19 +0100
commit9a31f6a360b162a2defc6ddaeddc49388a5dffbd (patch)
tree1f3c8b1f2282ef49d97c8aae3d05b0c5ec5e7d2c /gcc/testsuite
parentd925c9eb81d7a28e5fe3ed12a71aa7a0d3edab72 (diff)
downloadgcc-9a31f6a360b162a2defc6ddaeddc49388a5dffbd.tar.gz
[multiple changes]
2010-11-22 Uros Bizjak <ubizjak@gmail.com> * gcc.dg/graphite/graphite.exp: Use check_vect_support_and_set_flags for vectorizer tests. * gcc.dg/graphite/vect-pr43423.c: Add "dg-do compile" dg directive. * gcc.dg/graphite/pr40281.c: Remove "dg-do compile" dg directive. * gcc.dg/graphite/pr41888.c: Ditto. * gcc.dg/graphite/pr42729.c: Ditto. 2010-11-22 Mingjie Xing <mingjie.xing@gmail.com> Uros Bizjak <ubizjak@gmail.com> * lib/target-supports.exp (check_vect_support_and_set_flags): New procedure to check if the target supports vectorizer tests. Set DEFAULT_VECTCFLAGS and dg-do-what-default depending on vectorization capabilites. * gcc.dg/vect/vect.exp: Use check_vect_support_and_set_flags. * g++.dg/vect/vect.exp: Ditto. * gfortran.dg/vect/vect.exp: Ditto. From-SVN: r167055
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog22
-rw-r--r--gcc/testsuite/ChangeLog-20092
-rw-r--r--gcc/testsuite/g++.dg/vect/vect.exp76
-rw-r--r--gcc/testsuite/gcc.dg/graphite/graphite.exp9
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr40281.c1
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr41888.c1
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr42729.c1
-rw-r--r--gcc/testsuite/gcc.dg/graphite/vect-pr43423.c1
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect.exp80
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect.exp76
-rw-r--r--gcc/testsuite/lib/target-supports.exp95
11 files changed, 132 insertions, 232 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 274d4087497..ef33acb1f3b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,10 +1,30 @@
+2010-11-22 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/graphite/graphite.exp: Use check_vect_support_and_set_flags
+ for vectorizer tests.
+ * gcc.dg/graphite/vect-pr43423.c: Add "dg-do compile" dg directive.
+ * gcc.dg/graphite/pr40281.c: Remove "dg-do compile" dg directive.
+ * gcc.dg/graphite/pr41888.c: Ditto.
+ * gcc.dg/graphite/pr42729.c: Ditto.
+
+2010-11-22 Mingjie Xing <mingjie.xing@gmail.com>
+ Uros Bizjak <ubizjak@gmail.com>
+
+ * lib/target-supports.exp (check_vect_support_and_set_flags): New
+ procedure to check if the target supports vectorizer tests. Set
+ DEFAULT_VECTCFLAGS and dg-do-what-default depending on vectorization
+ capabilites.
+ * gcc.dg/vect/vect.exp: Use check_vect_support_and_set_flags.
+ * g++.dg/vect/vect.exp: Ditto.
+ * gfortran.dg/vect/vect.exp: Ditto.
+
2010-11-22 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/34033
* objc.dg/strings-1.m: New.
* objc.dg/strings-2.m: New.
* obj-c++.dg/strings-1.mm: New.
- * obj-c++.dg/strings-2.mm: New.
+ * obj-c++.dg/strings-2.mm: New.
2010-11-22 Ian Bolton <ian.bolton@arm.com>
diff --git a/gcc/testsuite/ChangeLog-2009 b/gcc/testsuite/ChangeLog-2009
index 005b4ac4e9d..a4614a03ec7 100644
--- a/gcc/testsuite/ChangeLog-2009
+++ b/gcc/testsuite/ChangeLog-2009
@@ -6853,7 +6853,7 @@
* gcc.dg/tree-ssa/fre-vce-1.c: Cleanup "fre" tree dump.
* gcc.dg/vect/vect-shift-2.c: Cleanup "vect" tree dump.
* gcc.dg/vect/vect.exp (VECT_SLP_CFLAGS): Initialize with original
- DEFAULT_VECTFLAGS.
+ DEFAULT_VECTCFLAGS.
2009-06-21 Ira Rosen <irar@il.ibm.com>
Revital Eres <eres@il.ibm.com>
diff --git a/gcc/testsuite/g++.dg/vect/vect.exp b/gcc/testsuite/g++.dg/vect/vect.exp
index 90ae38120b7..9a03f6c4286 100644
--- a/gcc/testsuite/g++.dg/vect/vect.exp
+++ b/gcc/testsuite/g++.dg/vect/vect.exp
@@ -36,6 +36,7 @@ global dg-do-what-default
set save-dg-do-what-default ${dg-do-what-default}
# Set up flags used for tests that don't specify options.
+global DEFAULT_VECTCFLAGS
set DEFAULT_VECTCFLAGS ""
# These flags are used for all targets.
@@ -45,80 +46,7 @@ lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" \
# Skip these tests for targets that do not support generating vector
# code. Set additional target-dependent vector flags, which can be
# overridden by using dg-options in individual tests.
-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*-*-*"] {
- # Skip targets not supporting -maltivec.
- if ![is-effective-target powerpc_altivec_ok] {
- return
- }
-
- lappend DEFAULT_VECTCFLAGS "-maltivec"
- if [check_vsx_hw_available] {
- lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
- }
-
- if [check_vmx_hw_available] {
- set dg-do-what-default run
- } else {
- if [is-effective-target ilp32] {
- # Specify a cpu that supports VMX for compile-only tests.
- lappend DEFAULT_VECTCFLAGS "-mcpu=970"
- }
- set dg-do-what-default compile
- }
-} elseif { [istarget "spu-*-*"] } {
- set dg-do-what-default run
-} 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*-*-*"]
- && ([check_effective_target_mpaired_single]
- || [check_effective_target_mips_loongson])
- && [check_effective_target_nomips16] } {
- if { [check_effective_target_mpaired_single] } {
- lappend DEFAULT_VECTCFLAGS "-mpaired-single"
- }
- set dg-do-what-default run
-} 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*-*-*"] {
- # 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
- # does work, command out the return.
- return
-
- lappend DEFAULT_VECTCFLAGS "-mmax"
- if [check_alpha_max_hw_available] {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
- }
-} 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 ""]
- if [is-effective-target arm_neon_hw] {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
- }
-} else {
+if ![check_vect_support_and_set_flags] {
return
}
diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp
index e6cdf12ed95..2111e384a5a 100644
--- a/gcc/testsuite/gcc.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp
@@ -49,7 +49,6 @@ set vect_files [lsort [glob -nocomplain $srcdir/$subdir/vect-*.c ] ]
set dg-do-what-default compile
dg-runtest $scop_files "" "-O2 -fgraphite -fdump-tree-graphite-all"
dg-runtest $id_files "" "-O2 -fgraphite-identity -ffast-math"
-dg-runtest $vect_files "" "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
# Tests to be run.
set dg-do-what-default run
@@ -57,6 +56,14 @@ dg-runtest $run_id_files "" "-O2 -fgraphite-identity"
dg-runtest $interchange_files "" "-O2 -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all"
dg-runtest $block_files "" "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all"
+# Vectorizer tests, to be run or compiled, depending on target capabilities.
+global DEFAULT_VECTCFLAGS
+set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
+
+if [check_vect_support_and_set_flags] {
+ dg-runtest $vect_files "" $DEFAULT_VECTCFLAGS
+}
+
# The default action for the rest of the files is 'compile'.
set dg-do-what-default compile
foreach f $scop_files {lremove wait_to_run_files $f}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr40281.c b/gcc/testsuite/gcc.dg/graphite/pr40281.c
index 437f3434e4b..255546b0cf0 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr40281.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr40281.c
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
/* { dg-options "-O -fprefetch-loop-arrays -w" } */
/* { dg-options "-O -fprefetch-loop-arrays -march=i686 -msse -w" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/pr41888.c b/gcc/testsuite/gcc.dg/graphite/pr41888.c
index b262af68e92..45df7df287e 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr41888.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr41888.c
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
/* { dg-options "-g -O2 -ftree-loop-distribution -fgraphite-identity" } */
int
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42729.c b/gcc/testsuite/gcc.dg/graphite/pr42729.c
index 3a0e901a13a..a9f1e2dee3f 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr42729.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr42729.c
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
/* { dg-options "-O1 -fgraphite-identity -fcompare-debug" } */
int A[10];
diff --git a/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c b/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c
index 5589167fbd3..bd685a651c8 100644
--- a/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c
+++ b/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c
@@ -1,3 +1,4 @@
+/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
int a[100], b[100], c[100];
diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp
index 5160020917b..170c33db2a5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -21,6 +21,7 @@
load_lib gcc-dg.exp
# Set up flags used for tests that don't specify options.
+global DEFAULT_VECTCFLAGS
set DEFAULT_VECTCFLAGS ""
# If the target system supports vector instructions, the default action
@@ -34,84 +35,7 @@ set save-dg-do-what-default ${dg-do-what-default}
# Skip these tests for targets that do not support generating vector
# code. Set additional target-dependent vector flags, which can be
# overridden by using dg-options in individual tests.
-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*-*-*"] {
- # Skip targets not supporting -maltivec.
- if ![is-effective-target powerpc_altivec_ok] {
- return
- }
-
- lappend DEFAULT_VECTCFLAGS "-maltivec"
- if [check_vsx_hw_available] {
- lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
- }
-
- if [check_vmx_hw_available] {
- set dg-do-what-default run
- } else {
- if [is-effective-target ilp32] {
- # Specify a cpu that supports VMX for compile-only tests.
- lappend DEFAULT_VECTCFLAGS "-mcpu=970"
- }
- set dg-do-what-default compile
- }
-} elseif { [istarget "spu-*-*"] } {
- set dg-do-what-default run
-} 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*-*-*"]
- && ([check_effective_target_mpaired_single]
- || [check_effective_target_mips_loongson])
- && [check_effective_target_nomips16] } {
- if { [check_effective_target_mpaired_single] } {
- lappend DEFAULT_VECTCFLAGS "-mpaired-single"
- }
- set dg-do-what-default run
-} 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*-*-*"] {
- # 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
- # does work, command out the return.
- return
-
- lappend DEFAULT_VECTCFLAGS "-mmax"
- if [check_alpha_max_hw_available] {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
- }
-} 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 ""]
- # NEON does not support denormals, so is not used for vectorization by
- # default to avoid loss of precision. We must pass -ffast-math to test
- # vectorization of float operations.
- lappend DEFAULT_VECTCFLAGS "-ffast-math"
- if [is-effective-target arm_neon_hw] {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
- }
-} else {
+if ![check_vect_support_and_set_flags] {
return
}
diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp
index d261376e5fe..11bcecd7caa 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect.exp
+++ b/gcc/testsuite/gfortran.dg/vect/vect.exp
@@ -21,6 +21,7 @@ load_lib gfortran-dg.exp
load_lib target-supports.exp
# Set up flags used for tests that don't specify options.
+global DEFAULT_VECTCFLAGS
set DEFAULT_VECTCFLAGS ""
# These flags are used for all targets.
@@ -38,80 +39,7 @@ set save-dg-do-what-default ${dg-do-what-default}
# Skip these tests for targets that do not support generating vector
# code. Set additional target-dependent vector flags, which can be
# overridden by using dg-options in individual tests.
-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*-*-*"] {
- # Skip targets not supporting -maltivec.
- if ![is-effective-target powerpc_altivec_ok] {
- return
- }
-
- lappend DEFAULT_VECTCFLAGS "-maltivec"
- if [check_vsx_hw_available] {
- lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
- }
-
- if [check_vmx_hw_available] {
- set dg-do-what-default run
- } else {
- if [is-effective-target ilp32] {
- # Specify a cpu that supports VMX for compile-only tests.
- lappend DEFAULT_VECTCFLAGS "-mcpu=970"
- }
- set dg-do-what-default compile
- }
-} elseif { [istarget "spu-*-*"] } {
- set dg-do-what-default run
-} 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*-*-*"]
- && ([check_effective_target_mpaired_single]
- || [check_effective_target_mips_loongson])
- && [check_effective_target_nomips16] } {
- if { [check_effective_target_mpaired_single] } {
- lappend DEFAULT_VECTCFLAGS "-mpaired-single"
- }
- set dg-do-what-default run
-} 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*-*-*"] {
- # 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
- # does work, command out the return.
- return
-
- lappend DEFAULT_VECTCFLAGS "-mmax"
- if [check_alpha_max_hw_available] {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
- }
-} 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 ""]
- if [is-effective-target arm_neon_hw] {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
- }
-} else {
+if ![check_vect_support_and_set_flags] {
return
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 50039e08f4c..c4433128989 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3768,3 +3768,98 @@ proc check_effective_target_run_expensive_tests { } {
proc check_effective_target_mempcpy {} {
return [check_function_available "mempcpy"]
}
+
+# Check whether the vectorizer tests are supported by the target and
+# append additional target-dependent compile flags to DEFAULT_VECTCFLAGS.
+# Set dg-do-what-default to either compile or run, depending on target
+# capabilities. Return 1 if vectorizer tests are supported by
+# target, 0 otherwise.
+
+proc check_vect_support_and_set_flags { } {
+ global DEFAULT_VECTCFLAGS
+ global dg-do-what-default
+
+ 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*-*-*"] {
+ # Skip targets not supporting -maltivec.
+ if ![is-effective-target powerpc_altivec_ok] {
+ return 0
+ }
+
+ lappend DEFAULT_VECTCFLAGS "-maltivec"
+ if [check_vsx_hw_available] {
+ lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
+ }
+
+ if [check_vmx_hw_available] {
+ set dg-do-what-default run
+ } else {
+ if [is-effective-target ilp32] {
+ # Specify a cpu that supports VMX for compile-only tests.
+ lappend DEFAULT_VECTCFLAGS "-mcpu=970"
+ }
+ set dg-do-what-default compile
+ }
+ } elseif { [istarget "spu-*-*"] } {
+ set dg-do-what-default run
+ } 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*-*-*"]
+ && ([check_effective_target_mpaired_single]
+ || [check_effective_target_mips_loongson])
+ && [check_effective_target_nomips16] } {
+ if { [check_effective_target_mpaired_single] } {
+ lappend DEFAULT_VECTCFLAGS "-mpaired-single"
+ }
+ set dg-do-what-default run
+ } 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*-*-*"] {
+ # 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
+ # does work, command out the return.
+ return 0
+
+ lappend DEFAULT_VECTCFLAGS "-mmax"
+ if [check_alpha_max_hw_available] {
+ set dg-do-what-default run
+ } else {
+ set dg-do-what-default compile
+ }
+ } 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 ""]
+ # NEON does not support denormals, so is not used for vectorization by
+ # default to avoid loss of precision. We must pass -ffast-math to test
+ # vectorization of float operations.
+ lappend DEFAULT_VECTCFLAGS "-ffast-math"
+ if [is-effective-target arm_neon_hw] {
+ set dg-do-what-default run
+ } else {
+ set dg-do-what-default compile
+ }
+ } else {
+ return 0
+ }
+
+ return 1
+}
+