While working on the libcilkrts SPARC port from PR target/68945, I noticed that the Cilk Plus testsuite has massive need for and potential of cleanup to easily accomodate non-x86 targets: * Every single execution test explicitly lists the targets to run on, often even twice (in the dg-do target selector and then again when adding -lcilkrts via dg-options). This is completely unmaintainable and should be replaced by a target selector. I'm using the current check_libcilkrts_available, renamed to cilkplus_runtime, for that purpose. There's no need to add -lcilkrts at all; -fcilkplus already does this when linking. * Two tests (c-c++-common/cilk-plus/CK/pr63307.c and c-c++-common/cilk-plus/SE/ef_error3.c) are pure compile tests and don't need a target selector at all. * This only leaves us with c-c++-common/cilk-plus/SE/ef_error2.c, where the expected warning is x86-specific, thus the target selector needs to stay. There's much opportunity for additional cleanup, already mentioned in the PR, but the current set is enough to successfully run the testsuite on Solaris/SPARC with the preliminary patch in PR target/68945. I'll address the rest in a follow-up. Tested with the appropriate runtest invocations on i386-pc-solaris2.12 and x86_64-pc-linux-gnu (and also on sparc-sun-solaris2.12 with the libcilkrts port): with the exception of a line number change for c-c++-common/cilk-plus/SE/ef_error2.c, results without and with the patch are identical. Will commit to mainline in a day or two, giving interested parties an opportunity to comment. Rainer 2016-04-05 Rainer Orth gcc: PR testsuite/70595 * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes): Document cilkplus_runtime. gcc/testsuite: PR testsuite/70595 * lib/target-supports.exp (check_libcilkrts_available): Rename to ... (check_effective_target_cilkplus_runtime): ... this. * g++.dg/cilk-plus/cilk-plus.exp: Adapt to it. * gcc.dg/cilk-plus/cilk-plus.exp: Likewise. * c-c++-common/cilk-plus/CK/cilk-for-2.c: Remove dg-do target selector. Require cilkplus_runtime. Don't add -lcilkrts. * c-c++-common/cilk-plus/CK/cilk-fors.c: Likewise. * c-c++-common/cilk-plus/CK/cilk_for_grain.c: Likewise. * c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: Likewise. * c-c++-common/cilk-plus/CK/fib.c: Likewise. * c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Likewise. * c-c++-common/cilk-plus/CK/fib_no_return.c: Likewise. * c-c++-common/cilk-plus/CK/fib_no_sync.c: Likewise. * c-c++-common/cilk-plus/CK/nested_cilk_for.c: Likewise. * c-c++-common/cilk-plus/CK/pr60586.c: Likewise. * c-c++-common/cilk-plus/CK/pr69826-1.c: Likewise. * c-c++-common/cilk-plus/CK/pr69826-2.c: Likewise. * c-c++-common/cilk-plus/CK/spawnee_inline.c: Likewise. * c-c++-common/cilk-plus/CK/spawner_inline.c: Likewise. * c-c++-common/cilk-plus/CK/spawning_arg.c: Likewise. * c-c++-common/cilk-plus/CK/steal_check.c: Likewise. * c-c++-common/cilk-plus/CK/varargs_test.c: Likewise. * g++.dg/cilk-plus/CK/catch_exc.cc: Likewise. * g++.dg/cilk-plus/CK/cilk-for-tplt.cc: Likewise. * g++.dg/cilk-plus/CK/const_spawn.cc: Likewise. * g++.dg/cilk-plus/CK/fib-opr-overload.cc: Likewise. * g++.dg/cilk-plus/CK/fib-tplt.cc: Likewise. * g++.dg/cilk-plus/CK/for1.cc: Likewise. * g++.dg/cilk-plus/CK/lambda_spawns.cc: Likewise. * g++.dg/cilk-plus/CK/lambda_spawns_tplt.cc: Likewise. * g++.dg/cilk-plus/CK/pr60586.cc: Likewise. * g++.dg/cilk-plus/CK/pr66326.cc: Likewise. * g++.dg/cilk-plus/CK/stl_iter.cc: Likewise. * g++.dg/cilk-plus/CK/stl_rev_iter.cc: Likewise. * g++.dg/cilk-plus/CK/stl_test.cc: Likewise. * c-c++-common/cilk-plus/CK/pr63307.c: Remove dg-do target selector. * c-c++-common/cilk-plus/SE/ef_error3.c: Likewise. * c-c++-common/cilk-plus/SE/ef_error2.c: Explain target selector. * c-c++-common/cilk-plus/CK/test__cilk.c: Run if cilkplus_runtime.