@subsubsection Skip a test for some targets
@table @code
+@item @{ dg-do-if @var{action} @{ @var{selector} @} @}
+Same as dg-do if the selector matches and the test hasn't already been
+marked as unsupported. Use it to override an action on a target while
+leaving the default action alone for other targets.
+
@item @{ dg-skip-if @var{comment} @{ @var{selector} @} [@{ @var{include-opts} @} [@{ @var{exclude-opts} @}]] @}
Arguments @var{include-opts} and @var{exclude-opts} are lists in which
each element is a string of zero or more GCC options.
+/* { dg-do-if compile { target { sse2_runtime && { ! sse4_runtime } } } } */
/* { dg-require-effective-target vect_simd_clones } */
/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
+/* { dg-additional-options "-msse4" { target sse4 } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-additional-options "-mno-avx512f" { target { { i?86*-*-* x86_64-*-* } && { ! lp64 } } } } */
+/* { dg-do-if compile { target { sse2_runtime && { ! sse4_runtime } } } } */
/* { dg-require-effective-target vect_simd_clones } */
/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
+/* { dg-additional-options "-msse4" { target sse4 } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-additional-options "-mno-avx512f" { target { { i?86*-*-* x86_64-*-* } && { ! lp64 } } } } */
+/* { dg-do-if compile { target { sse2_runtime && { ! sse4_runtime } } } } */
/* { dg-require-effective-target vect_simd_clones } */
/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
+/* { dg-additional-options "-msse4" { target sse4 } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-additional-options "-mno-avx512f" { target { { i?86*-*-* x86_64-*-* } && { ! lp64 } } } } */
+/* { dg-do-if compile { target { sse2_runtime && { ! sse4_runtime } } } } */
/* { dg-require-effective-target vect_simd_clones } */
/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
+/* { dg-additional-options "-msse4" { target sse4 } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* Test that simd inbranch clones work correctly. */
}
/* Ensure the the in-branch simd clones are used on targets that support them. */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { aarch64*-*-* } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { x86_64*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { aarch64*-*-* || { sse4 && { ! avx_runtime } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { avx_runtime } } } } */
/* The LTO test produces two dump files and we scan the wrong one. */
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
return $result
}
+# Override dg-do action on target, without setting the test as
+# unsupported on other targets. Multiple such overriders can be
+# present. If the test is already marked as unsupported, it has no
+# effect. Otherwise, if the target selector matches, call dg-do,
+# otherwise leave dg-do-what alone, so that any earlier setting
+# (possibly the default) prevails.
+
+proc dg-do-if { args } {
+ set args [lreplace $args 0 0]
+ # Verify the number of arguments.
+ if { [llength $args] != 2 } {
+ error "syntax error, need a single action and target selector"
+ }
+
+ # Don't bother if we're already skipping the test.
+ upvar dg-do-what dg-do-what
+ if { [lindex ${dg-do-what} 1] == "N" } {
+ return
+ }
+
+ # Evaluate selector, return if it does not match.
+ switch [dg-process-target-1 [lindex $args 1]] {
+ "N" { return }
+ "P" { return }
+ }
+
+ eval dg-do $args
+}
+
# Skip the test (report it as UNSUPPORTED) if the target list and
# included flags are matched and the excluded flags are not matched.
#