aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog10
-rw-r--r--gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp3
-rw-r--r--gdb/testsuite/gdb.compile/compile-cplus.exp12
-rw-r--r--gdb/testsuite/lib/gdb.exp8
4 files changed, 21 insertions, 12 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6f4d99d..1b77459 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,15 @@
2020-06-24 Pedro Alves <palves@redhat.com>
+ * gdb.arch/amd64-entry-value-paramref.exp: Use
+ prepare_for_testing_full and don't pass "c++" for the .S file
+ build spec.
+ * gdb.compile/compile-cplus.exp: Don't compile $srcfile3 with
+ $options, since it's an assembly file. Remove -Wno-deprecated.
+ * lib/gdb.exp (gdb_compile): Pass "-x c++" explicitly when
+ compiling C++ programs.
+
+2020-06-24 Pedro Alves <palves@redhat.com>
+
* lib/gdb.exp (gdb_compile): Update intro comment. If C/C++ with
Clang, add "-Wno-unknown-warning-option" to the options.
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
index be60e25..cbb69f4 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
@@ -20,7 +20,8 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
return
}
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} "c++"] } {
+if { [prepare_for_testing_full "failed to prepare" \
+ [list $testfile "c++" $srcfile {}]] } {
return -1
}
diff --git a/gdb/testsuite/gdb.compile/compile-cplus.exp b/gdb/testsuite/gdb.compile/compile-cplus.exp
index 85b2f20..f794e5a 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus.exp
@@ -24,11 +24,6 @@ if { [test_compiler_info gcc*] || [test_compiler_info clang*] } {
lappend options additional_flags=-std=gnu++11
lappend options c++
}
-if [test_compiler_info clang*] {
- # Treating C input as C++ is deprecated in Clang, so
- # the build will fail without disabling -Wdeprecated.
- lappend options additional_flags=-Wno-deprecated
-}
if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
verbose "Skipping x86_64 LOC_CONST test."
@@ -37,14 +32,9 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
set srcfilesoptions [list ${srcfile} ${options}]
if { $srcfile3 != "" } {
- lappend srcfilesoptions $srcfile3 ${options}
+ lappend srcfilesoptions $srcfile3 {}
}
set srcfile4options "nodebug c++"
-if [test_compiler_info clang*] {
- # Treating C input as C++ is deprecated in Clang, so
- # the build will fail without disabling -Wdeprecated.
- set srcfile4options "$srcfile4options additional_flags=-Wno-deprecated"
-}
lappend srcfilesoptions $srcfile4 $srcfile4options
if { [eval build_executable_from_specs ${testfile}.exp $testfile {$options} ${srcfilesoptions}] } {
return -1
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6b4f71b..8dbfa7e 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3868,6 +3868,14 @@ proc gdb_compile {source dest type options} {
lappend new_options "additional_flags=-Wno-unknown-warning-option"
}
+ # Treating .c input files as C++ is deprecated in Clang, so
+ # explicitly force C++ language.
+ if { [lsearch -exact $options getting_compiler_info] == -1
+ && [lsearch -exact $options c++] != -1
+ && [test_compiler_info "clang-*"]} {
+ lappend new_options additional_flags=-x\ c++
+ }
+
# Place (and look for) Fortran `.mod` files in the output
# directory for this specific test.
if {[lsearch -exact $options f77] != -1 \