diff --git a/gcc/testsuite/gcc.dg/visibility-22.c b/gcc/testsuite/gcc.dg/visibility-22.c --- a/gcc/testsuite/gcc.dg/visibility-22.c +++ b/gcc/testsuite/gcc.dg/visibility-22.c @@ -3,6 +3,7 @@ /* { dg-require-visibility "" } */ /* { dg-require-effective-target weak_undefined } */ /* { dg-options "-O2 -fPIC" { target fpic } } */ +/* { dg-add-options weak_undefined } */ extern void foo () __attribute__((weak,visibility("hidden"))); int diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -361,7 +361,7 @@ proc check_weak_available { } { proc add_options_for_weak_undefined { flags } { if { [istarget *-*-darwin*] } { lappend flags "-Wl,-undefined,dynamic_lookup" - if { [istarget *-*-darwin[89]*] } { + if { [istarget *-*-darwin\[89\]*] } { lappend flags "-Wl,-flat_namespace" } } diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-2.c --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-2.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-2.c @@ -8,6 +8,7 @@ /* { dg-additional-sources routine-nohost-2_2.c } */ /* { dg-additional-options "-fno-inline" } for stable results regarding OpenACC 'routine'. */ +/* { dg-add-options weak_undefined } */ #include #include