Hi. It's fix for Darwin target and similar others which do not support the asembler directive.
Ready for master? Thanks, Martin gcc/testsuite/ChangeLog: 2020-03-16 Martin Liska <mli...@suse.cz> PR lto/94157 * gcc.dg/lto/pr94157_0.c: Add wa_noexecstack effective target filter. * lib/target-supports.exp: Add check_effective_target_wa_noexecstack. --- gcc/testsuite/gcc.dg/lto/pr94157_0.c | 1 + gcc/testsuite/lib/target-supports.exp | 10 ++++++++++ 2 files changed, 11 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/lto/pr94157_0.c b/gcc/testsuite/gcc.dg/lto/pr94157_0.c index 3bca677c4fb..3745fee217f 100644 --- a/gcc/testsuite/gcc.dg/lto/pr94157_0.c +++ b/gcc/testsuite/gcc.dg/lto/pr94157_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target wa_noexecstack } */ /* { dg-lto-options { { -O0 -fipa-vrp -flto -Wa,--noexecstack -Wa,--noexecstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack } } } */ int main() { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ca3895c2269..589192d9edb 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1022,6 +1022,16 @@ proc check_effective_target_fgnu_tm {} { } "-fgnu-tm"] } +# Return 1 if compilation with -Wa,--noexecstack is error-free for trivial +# code, 0 otherwise. + +proc check_effective_target_wa_noexecstack {} { + return [check_no_compiler_messages wa_noexecstack object { + void foo (void) { } + } "-Wa,--noexecstack"] +} + + # Return 1 if the target supports mmap, 0 otherwise. proc check_effective_target_mmap {} {