aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-08-29 17:27:19 +0200
committerTom de Vries <tdevries@suse.de>2023-08-29 17:27:19 +0200
commit62b28bd6688c933b9ffa56f53be1f827450625a7 (patch)
treefbaa4d218b25357d897c7cd1ad4759089809d946
parentee12f46f45cd2dd6a7638d1bdc6534301a9c55ba (diff)
downloadbinutils-62b28bd6688c933b9ffa56f53be1f827450625a7.zip
binutils-62b28bd6688c933b9ffa56f53be1f827450625a7.tar.gz
binutils-62b28bd6688c933b9ffa56f53be1f827450625a7.tar.bz2
[gdb/testsuite] Handle some test-cases with older compiler
When running test-case gdb.mi/print-simple-values.exp with gcc 4.8.4, I run into a compilation failure due to the test-case requiring c++11 and the compiler defaulting to less than that. Fix this by compiling with -std=c++11. Likewise in a few other test-cases. Tested on x86_64-linux.
-rw-r--r--gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/nullptr_t.exp7
-rw-r--r--gdb/testsuite/gdb.fortran/mixed-lang-stack.exp2
-rw-r--r--gdb/testsuite/gdb.linespec/cpcompletion.exp6
-rw-r--r--gdb/testsuite/gdb.mi/print-simple-values.exp7
5 files changed, 23 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp
index 6fffc98..f2b0b72 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp
@@ -17,8 +17,12 @@ load_lib dwarf.exp
standard_testfile index.cc
+set opts {}
+lappend opts debug
+lappend opts additional_flags=-std=c++11
+
if {[prepare_for_testing "failed to prepare" "${testfile}" \
- [list ${srcfile}]]} {
+ [list ${srcfile}] $opts]} {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/nullptr_t.exp b/gdb/testsuite/gdb.dwarf2/nullptr_t.exp
index c40c767..df2f163 100644
--- a/gdb/testsuite/gdb.dwarf2/nullptr_t.exp
+++ b/gdb/testsuite/gdb.dwarf2/nullptr_t.exp
@@ -17,7 +17,12 @@ require allow_cplus_tests
standard_testfile .cc
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}] {
+set opts {}
+lappend opts debug
+lappend opts c++
+lappend opts additional_flags=-std=c++11
+
+if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
return -1
}
diff --git a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
index 5fc36f7..3973f68 100644
--- a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
+++ b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
@@ -30,7 +30,7 @@ standard_testfile mixed-lang-stack.c mixed-lang-stack.cpp mixed-lang-stack.f90
if {[prepare_for_testing_full "failed to prepare" \
[list ${binfile} {debug f90 additional_flags=-lstdc++} \
$srcfile {debug} \
- $srcfile2 {debug c++} \
+ $srcfile2 {debug c++ additional_flags=-std=c++11} \
$srcfile3 {debug f90}]]} {
return -1
}
diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp
index f005707..23bec06 100644
--- a/gdb/testsuite/gdb.linespec/cpcompletion.exp
+++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp
@@ -20,8 +20,12 @@ load_lib data-structures.exp
standard_testfile cpls.cc cpls2.cc cpls-hyphen.cc
+set opts {}
+lappend opts debug
+lappend opts additional_flags=-std=c++11
+
if {[prepare_for_testing "failed to prepare" $testfile \
- [list $srcfile $srcfile2 $srcfile3] {debug}]} {
+ [list $srcfile $srcfile2 $srcfile3] $opts]} {
return -1
}
diff --git a/gdb/testsuite/gdb.mi/print-simple-values.exp b/gdb/testsuite/gdb.mi/print-simple-values.exp
index 9436645..267cf36 100644
--- a/gdb/testsuite/gdb.mi/print-simple-values.exp
+++ b/gdb/testsuite/gdb.mi/print-simple-values.exp
@@ -25,7 +25,12 @@ set MIFLAGS "-i=mi"
standard_testfile .cc
-if [build_executable "failed to prepare" $testfile $srcfile {debug c++}] {
+set opts {}
+lappend opts debug
+lappend opts c++
+lappend opts additional_flags=-std=c++11
+
+if [build_executable "failed to prepare" $testfile $srcfile $opts] {
return -1
}