From f043f7346c4d2bc2a3b1c3b59572a3d416fe46c8 Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Fri, 29 Apr 2022 18:07:26 +0100 Subject: PR-105411 BugFix gm2 testsuite now uses TEST_ALWAYS_FLAGS. 2022-04-29 Gaius Mulley gcc/testsuite/ChangeLog: * gcc/testsuite/lib/gm2.exp (gm2_target_compile_default): Add TEST_ALWAYS_FLAGS to allow individual tests to override options. Signed-off-by: Gaius Mulley --- gcc/testsuite/lib/gm2.exp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/lib/gm2.exp b/gcc/testsuite/lib/gm2.exp index a5ee403..9506c3b 100644 --- a/gcc/testsuite/lib/gm2.exp +++ b/gcc/testsuite/lib/gm2.exp @@ -142,9 +142,10 @@ proc gm2_init { args } { # proc gm2_target_compile_default { source dest type options } { - global gluefile wrap_flags; - global GCC_UNDER_TEST; - global TOOL_OPTIONS; + global gluefile wrap_flags + global GCC_UNDER_TEST + global TOOL_OPTIONS + global TEST_ALWAYS_FLAGS if {[target_info needs_status_wrapper] != "" && \ [target_info needs_status_wrapper] != "0" && \ @@ -153,6 +154,13 @@ proc gm2_target_compile_default { source dest type options } { lappend options "ldflags=$wrap_flags" } + # TEST_ALWAYS_FLAGS are flags that should be passed to every + # compilation. They are passed first to allow individual + # tests to override them. + if [info exists TEST_ALWAYS_FLAGS] { + set options [concat "{additional_flags=$TEST_ALWAYS_FLAGS}" $options] + } + if [target_info exists gcc,stack_size] { lappend options "additional_flags=-DSTACK_SIZE=[target_info gcc,stack_size]" } -- cgit v1.1