* [PATCH] gdb/testsuite: Disable gdb.compile when testing with clang
@ 2023-07-14 10:35 Bruno Larsen
2023-07-14 16:33 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Bruno Larsen @ 2023-07-14 10:35 UTC (permalink / raw)
To: gdb-patches; +Cc: Bruno Larsen
Attempting to test the gdb.compile with clang as the compiler results in
over 300 unexpected errors, due to a segmentation fault and several
handshake failures. Since these tests are also very shaky on gcc, This
commit only disables them for clang instead of attempting to fix them.
---
gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-inherit.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-member.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-method.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-namespace.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-nested.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-print.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus-virtual.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-cplus.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-ifunc.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-ops.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-print.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-setjmp.exp | 5 +++++
gdb/testsuite/gdb.compile/compile-tls.exp | 5 +++++
gdb/testsuite/gdb.compile/compile.exp | 3 +++
16 files changed, 78 insertions(+)
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
index 26cfab50914..119f1f6771f 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp b/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
index 05962208e2e..92a5d62b3e5 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++ additional_flags=-std=c++11}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp b/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
index a6cfeb6fe5a..346e21e1d83 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-member.exp b/gdb/testsuite/gdb.compile/compile-cplus-member.exp
index da9418edf53..522f5cbe0bf 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-member.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-member.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-method.exp b/gdb/testsuite/gdb.compile/compile-cplus-method.exp
index 994e00d48c4..f4b44800297 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-method.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-method.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp b/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
index 65cc3ac51c3..dc9eec50c77 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-nested.exp b/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
index 86fddb324aa..bd5eb751757 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-print.exp b/gdb/testsuite/gdb.compile/compile-cplus-print.exp
index a30ad2a44e8..84c95f0adcc 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-print.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-print.exp
@@ -17,6 +17,11 @@ load_lib compile-support.exp
standard_testfile
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
set options {}
if [test_compiler_info gcc*] {
lappend options additional_flags=-g3
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp b/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
index f50e385ff73..f09ec1731f1 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
@@ -21,6 +21,11 @@ standard_testfile .cc
require allow_cplus_tests
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile-cplus.exp b/gdb/testsuite/gdb.compile/compile-cplus.exp
index 4e887daeb29..428e4857d20 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus.exp
@@ -17,6 +17,11 @@ load_lib compile-support.exp
standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
set options {}
if { [test_compiler_info gcc*] || [test_compiler_info clang*] } {
lappend options additional_flags=-g3
diff --git a/gdb/testsuite/gdb.compile/compile-ifunc.exp b/gdb/testsuite/gdb.compile/compile-ifunc.exp
index 990d35a53f6..8e32ace60e9 100644
--- a/gdb/testsuite/gdb.compile/compile-ifunc.exp
+++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp
@@ -19,6 +19,11 @@ require allow_ifunc_tests
standard_testfile
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
set flags ""
if [test_compiler_info gcc*] {
set flags additional_flags=-Wno-attribute-alias
diff --git a/gdb/testsuite/gdb.compile/compile-ops.exp b/gdb/testsuite/gdb.compile/compile-ops.exp
index 3935d472389..d4438600121 100644
--- a/gdb/testsuite/gdb.compile/compile-ops.exp
+++ b/gdb/testsuite/gdb.compile/compile-ops.exp
@@ -22,6 +22,11 @@ load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
require dwarf2_support
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
standard_testfile .c -dbg.S
#
diff --git a/gdb/testsuite/gdb.compile/compile-print.exp b/gdb/testsuite/gdb.compile/compile-print.exp
index 33f1949b958..5a1d56b99bd 100644
--- a/gdb/testsuite/gdb.compile/compile-print.exp
+++ b/gdb/testsuite/gdb.compile/compile-print.exp
@@ -17,6 +17,11 @@ load_lib compile-support.exp
standard_testfile
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if { [prepare_for_testing "failed to prepare" "$testfile"] } {
return -1
}
diff --git a/gdb/testsuite/gdb.compile/compile-setjmp.exp b/gdb/testsuite/gdb.compile/compile-setjmp.exp
index 3fc3b6d7ad1..2140953aa3d 100644
--- a/gdb/testsuite/gdb.compile/compile-setjmp.exp
+++ b/gdb/testsuite/gdb.compile/compile-setjmp.exp
@@ -17,6 +17,11 @@ load_lib compile-support.exp
standard_testfile .c compile-setjmp-mod.c
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if { [prepare_for_testing "failed to prepare" $testfile] } {
return -1
}
diff --git a/gdb/testsuite/gdb.compile/compile-tls.exp b/gdb/testsuite/gdb.compile/compile-tls.exp
index e9281aa6e72..2b6c37173e3 100644
--- a/gdb/testsuite/gdb.compile/compile-tls.exp
+++ b/gdb/testsuite/gdb.compile/compile-tls.exp
@@ -17,6 +17,11 @@ load_lib compile-support.exp
standard_testfile .c
+if ![test_compiler_info gcc*] {
+ untested "GCC is required for this test"
+ return
+}
+
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable {debug}] != "" } {
return -1
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
index f3d87cd2605..e3ef50fb31e 100644
--- a/gdb/testsuite/gdb.compile/compile.exp
+++ b/gdb/testsuite/gdb.compile/compile.exp
@@ -20,6 +20,9 @@ standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
set options {}
if [test_compiler_info gcc*] {
lappend options additional_flags=-g3
+} else {
+ untested "compile tests only make sense with gcc"
+ return 0
}
if { ![is_x86_64_m64_target] } {
--
2.41.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gdb/testsuite: Disable gdb.compile when testing with clang
2023-07-14 10:35 [PATCH] gdb/testsuite: Disable gdb.compile when testing with clang Bruno Larsen
@ 2023-07-14 16:33 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-07-14 16:33 UTC (permalink / raw)
To: Bruno Larsen via Gdb-patches; +Cc: Bruno Larsen
>>>>> "Bruno" == Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:
Bruno> Attempting to test the gdb.compile with clang as the compiler results in
Bruno> over 300 unexpected errors, due to a segmentation fault and several
Bruno> handshake failures. Since these tests are also very shaky on gcc, This
Bruno> commit only disables them for clang instead of attempting to fix them.
Bruno> require allow_cplus_tests
Bruno> +if ![test_compiler_info gcc*] {
Bruno> + untested "GCC is required for this test"
Bruno> + return
It's better to use some 'require' formulation than to add new calls to
untested.
Bruno> @@ -20,6 +20,9 @@ standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
Bruno> set options {}
Bruno> if [test_compiler_info gcc*] {
Bruno> lappend options additional_flags=-g3
Bruno> +} else {
Bruno> + untested "compile tests only make sense with gcc"
Bruno> + return 0
Bruno> }
In this spot require can be used and then the 'if' removed.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-14 16:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 10:35 [PATCH] gdb/testsuite: Disable gdb.compile when testing with clang Bruno Larsen
2023-07-14 16:33 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).