From a03e9c2782b42ba82a80164ffc9cf956b9dc092c Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 4 Feb 2025 13:53:20 +0100 Subject: [gdb/testsuite] Use c++ flag in c++ test-cases In some cases, test-cases use c++, but don't add "c++" to the compilation flags. This can cause problems with some compilers. Fix this in some test-cases. Approved-By: Tom Tromey PR testsuite/30380 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30380 --- gdb/testsuite/gdb.base/condbreak-multi-context.exp | 6 +++++- gdb/testsuite/gdb.base/main-psymtab.exp | 6 +++++- gdb/testsuite/gdb.base/persistent-lang.exp | 6 +++++- gdb/testsuite/gdb.base/skipcxx.exp | 6 +++++- gdb/testsuite/gdb.base/start-cpp.exp | 6 +++++- 5 files changed, 25 insertions(+), 5 deletions(-) (limited to 'gdb/testsuite/gdb.base') diff --git a/gdb/testsuite/gdb.base/condbreak-multi-context.exp b/gdb/testsuite/gdb.base/condbreak-multi-context.exp index 3af3708..3a4fe37 100644 --- a/gdb/testsuite/gdb.base/condbreak-multi-context.exp +++ b/gdb/testsuite/gdb.base/condbreak-multi-context.exp @@ -18,7 +18,11 @@ standard_testfile .cc -if {[prepare_for_testing "failed to prepare" ${binfile} ${srcfile}]} { +set flags {} +lappend flags debug +lappend flags c++ + +if {[prepare_for_testing "failed to prepare" ${binfile} ${srcfile} $flags]} { return } diff --git a/gdb/testsuite/gdb.base/main-psymtab.exp b/gdb/testsuite/gdb.base/main-psymtab.exp index 2cd0d61..cc0ca65 100644 --- a/gdb/testsuite/gdb.base/main-psymtab.exp +++ b/gdb/testsuite/gdb.base/main-psymtab.exp @@ -15,7 +15,11 @@ standard_testfile persistent-lang.cc -if {[build_executable "failed to prepare" $testfile $srcfile debug]} { +set flags {} +lappend flags debug +lappend flags c++ + +if {[build_executable "failed to prepare" $testfile $srcfile $flags]} { return -1 } diff --git a/gdb/testsuite/gdb.base/persistent-lang.exp b/gdb/testsuite/gdb.base/persistent-lang.exp index f813915..d3bedae 100644 --- a/gdb/testsuite/gdb.base/persistent-lang.exp +++ b/gdb/testsuite/gdb.base/persistent-lang.exp @@ -15,7 +15,11 @@ standard_testfile .cc -if {[build_executable "failed to prepare" $testfile $srcfile debug]} { +set flags {} +lappend flags debug +lappend flags c++ + +if {[build_executable "failed to prepare" $testfile $srcfile $flags]} { return -1 } diff --git a/gdb/testsuite/gdb.base/skipcxx.exp b/gdb/testsuite/gdb.base/skipcxx.exp index 60b8fa1..73beed8 100644 --- a/gdb/testsuite/gdb.base/skipcxx.exp +++ b/gdb/testsuite/gdb.base/skipcxx.exp @@ -15,7 +15,11 @@ standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { +set flags {} +lappend flags debug +lappend flags c++ + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { return -1 } diff --git a/gdb/testsuite/gdb.base/start-cpp.exp b/gdb/testsuite/gdb.base/start-cpp.exp index b4a036e..330c6ea 100644 --- a/gdb/testsuite/gdb.base/start-cpp.exp +++ b/gdb/testsuite/gdb.base/start-cpp.exp @@ -17,7 +17,11 @@ require !use_gdb_stub standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { +set flags {} +lappend flags debug +lappend flags c++ + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { return -1 } -- cgit v1.1