From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 2163938582B6; Tue, 1 Nov 2022 11:43:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2163938582B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667302996; bh=W1rTt/8Cbur5qDUav44740Wl42coLTKsdX22Y8sfvwA=; h=From:To:Subject:Date:From; b=MaTxxZf3MHuHxwOuykxlFopgzYbtJQpAZS2pKG1TqFWWdAg1101+XCTeoatpT8rPA PXGOZlUO8s1PKKhNFBMzlxnBrM90Z3QJDSG2GvYe8Tn5TDP+Zm1wpFBc7RMprG+My6 9+g6Ww7Mc3KJfWM+y2MxWn++wUqlzsAqjl6H2nZ0= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/c++-contracts] c++: pass dg-options to module link X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/devel/c++-contracts X-Git-Oldrev: a7a4a4ea950bed8f375f6fef8117a41cb238a1a2 X-Git-Newrev: ce5faeb1f533e2cdd4b0f45f18770e0a26f05182 Message-Id: <20221101114316.2163938582B6@sourceware.org> Date: Tue, 1 Nov 2022 11:43:16 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ce5faeb1f533e2cdd4b0f45f18770e0a26f05182 commit ce5faeb1f533e2cdd4b0f45f18770e0a26f05182 Author: Jason Merrill Date: Wed Oct 26 21:37:09 2022 -0400 c++: pass dg-options to module link The link command needs to see -fcontracts for it to automatically add -lstdc++exp. gcc/testsuite/ChangeLog: * g++.dg/modules/modules.exp: Pass dg-options to link command. Diff: --- gcc/testsuite/g++.dg/modules/modules.exp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp index afb323d0efd..45ff74c6aa9 100644 --- a/gcc/testsuite/g++.dg/modules/modules.exp +++ b/gcc/testsuite/g++.dg/modules/modules.exp @@ -187,8 +187,9 @@ proc module_do_it { do_what testcase std asm_list } { lappend options "additional_flags=$std" set ident "$ident $std" } - if { [llength $do_what] > 3 } { - lappend options "additional_flags=[lindex $do_what 3]" + global extra_tool_flags + if { [llength $extra_tool_flags] } { + lappend options "additional_flags=$extra_tool_flags" } set execname "./[file tail $testcase].exe" @@ -250,6 +251,8 @@ proc module-init { src } { set option_list {} set have_std 0 set std_prefix "-std=c++" + global extra_tool_flags + set extra_tool_flags {} foreach op $tmp { switch [lindex $op 0] { @@ -258,11 +261,13 @@ proc module-init { src } { if { [string match "*-std=*" [lindex $op 2]] } { set have_std 1 } + eval lappend extra_tool_flags [lindex $op 2] } "dg-additional-options" { if { [string match "*-std=*" [lindex $op 2]] } { set have_std 1 } + eval lappend extra_tool_flags [lindex $op 2] } } }