From 8370a35d4b82da51bfc96f6bb5f6e8227d8b6fea Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 29 Aug 2023 17:27:19 +0200 Subject: [PATCH] [gdb/testsuite] Require gcc >= 5 in gdb.linespec/cpls-abi-tag.exp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When running test-case gdb.linespec/cpls-abi-tag.exp with gcc 4.8.4, we run into: ... cpls-abi-tag.cc:71:26: error: ‘abi_tag’ attribute applied to non-function ‘s’ ABI3 test_abi_tag_struct s; ^ ... The test-case is supported starting gcc 5. Fix this by requiring gcc >= 5, if a gcc compiler is used. Tested on x86_64-linux. --- gdb/testsuite/gdb.linespec/cpls-abi-tag.exp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp index 63b4ccf4b4c..e24a5bf18e7 100644 --- a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp +++ b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp @@ -21,6 +21,14 @@ load_lib completion-support.exp standard_testfile cpls-abi-tag.cc +if { [test_compiler_info gcc-*] } { + # With earlier gcc versions we run into: + # cpls-abi-tag.cc:71:26: error: + # ‘abi_tag’ attribute applied to non-function ‘s’ + # See gcc PR65046. + require {expr [gcc_major_version] >= 5} +} + if {[prepare_for_testing "failed to prepare" $testfile \ [list $srcfile] {c++ debug}]} { return -1 -- 2.30.2