From 8e655a0786aec5e0215e09f2a9629c6f32e34793 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 28 Aug 2026 02:39:42 +0200 Subject: Reject declarations shadowing imports --- rakelib/gcc.rake | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'rakelib/gcc.rake') diff --git a/rakelib/gcc.rake b/rakelib/gcc.rake index db832e1..30175eb 100644 --- a/rakelib/gcc.rake +++ b/rakelib/gcc.rake @@ -249,13 +249,19 @@ namespace :gcc do modules.each do |extra| cp_r extra, test_target end - extra_sources = test_target.glob("**/*.elna") - .map { |extra| %("#{extra.relative_path_from test_target}") } - - convert_test main, (test_target + 'sut.elna'), category, [ - "(* { dg-additional-options \"-I#{test_target.expand_path}\" } *)", - "(* { dg-additional-sources #{extra_sources * ' '} } *)" - ] + extra_lines = ["(* { dg-additional-options \"-I#{test_target.expand_path}\" } *)"] + + # Only 'runnable' tests link the helper modules into an executable, + # so only they need the helper sources compiled as separate + # translation units via dg-additional-sources. Elna resolves imports + # on its own, so passing it as an additional source there would add a + # second positional. + if category == 'runnable' + extra_sources = test_target.glob("**/*.elna") + .map { |extra| %("#{extra.relative_path_from test_target}") } + extra_lines << "(* { dg-additional-sources #{extra_sources * ' '} } *)" + end + convert_test main, (test_target + 'sut.elna'), category, extra_lines else convert_test test_path, test_target, category end -- cgit v1.2.3