diff options
Diffstat (limited to 'libgomp/testsuite/libgomp.oacc-c/c.exp')
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c/c.exp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp index 5020e6a0691..b509a109815 100644 --- a/libgomp/testsuite/libgomp.oacc-c/c.exp +++ b/libgomp/testsuite/libgomp.oacc-c/c.exp @@ -13,14 +13,11 @@ if [info exists lang_include_flags] then { load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp - -# If a testcase doesn't have special options, use these. -if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS "-O2" -} +load_gcc_lib torture-options.exp # Initialize dg. dg-init +torture-init # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=-fopenacc" @@ -67,8 +64,28 @@ foreach offload_target_openacc $offload_targets_s_openacc { setenv ACC_DEVICE_TYPE $offload_target_openacc - dg-runtest $tests "$tagopt" $DEFAULT_CFLAGS + # To get better test coverage for device-specific code that is only + # ever used in offloading configurations, we'd like more thorough + # testing for test cases that deal with offloading, which most of all + # OpenACC test cases are. We enable torture testing, but limit it to + # -O0 and -O2 only, to avoid testing times exploding too much, under + # the assumption that between -O0 and -O[something] there is the + # biggest difference in the overall structure of the generated code. + switch $offload_target_openacc { + host { + set-torture-options [list \ + { -O2 } ] + } + default { + set-torture-options [list \ + { -O0 } \ + { -O2 } ] + } + } + + gcc-dg-runtest $tests "$tagopt" "" } # All done. +torture-finish dg-finish |