diff --git a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 index 4351874825e..e646fc86b80 100644 --- a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 +++ b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 @@ -1,6 +1,4 @@ -! Using two spaces between dg-do and run is a hack to keep gfortran-dg-runtest -! from cycling through optimization options for this expensive test. -! { dg-do run } +! { dg-do run } ! { dg-options "-O3 -fcray-pointer -fbounds-check -fno-inline" } ! { dg-timeout-factor 4 } ! diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp index a516babdc3b..4abf2fe5dcc 100644 --- a/gcc/testsuite/lib/gfortran-dg.exp +++ b/gcc/testsuite/lib/gfortran-dg.exp @@ -149,7 +149,13 @@ proc gfortran-dg-runtest { testcases flags default-extra-flags } { # look if this is dg-do run test, in which case # we cycle through the option list, otherwise we don't if [expr [search_for $test "dg-do run"]] { - set option_list $torture_with_loops + if { [ expr [search_for $test "dg-options*\[ \t\"\{]-O"] ] \ + || [ expr [search_for $test \ + "dg-additional-options*\[ \t\"\{]-O"] ] } { + set option_list [list { -O } ] + } else { + set option_list $torture_with_loops + } } else { set option_list [list { -O } ] }