[PING][PATCH v2] gdb/testsuite: Disable gdb.compile when testing with clang

Bruno Larsen blarsen@redhat.com
Thu Aug 3 13:42:43 GMT 2023


Ping!

-- 
Cheers,
Bruno

On 19/07/2023 16:40, Bruno Larsen wrote:
> 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 the whole feature is designed around a gcc
> plugin, and even the gcc testing is shaky at best, this commit restricts
> those tests to only running under gcc. If that gets fixed, this commit
> can be reverted.
> ---
>
> Changes for v2:
> * Used require instead of "if" when checking compiler
>
>
>   gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp   | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-inherit.exp     | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-member.exp      | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-method.exp      | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-namespace.exp   | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-nested.exp      | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-print.exp       | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus-virtual.exp     | 2 ++
>   gdb/testsuite/gdb.compile/compile-cplus.exp             | 2 ++
>   gdb/testsuite/gdb.compile/compile-ifunc.exp             | 2 ++
>   gdb/testsuite/gdb.compile/compile-ops.exp               | 2 ++
>   gdb/testsuite/gdb.compile/compile-print.exp             | 2 ++
>   gdb/testsuite/gdb.compile/compile-setjmp.exp            | 2 ++
>   gdb/testsuite/gdb.compile/compile-tls.exp               | 2 ++
>   gdb/testsuite/gdb.compile/compile.exp                   | 6 ++----
>   16 files changed, 32 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
> index 26cfab50914..b4001347a7b 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..4ab69281336 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..76d80bbbaf8 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..9fccfd8992f 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-member.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-member.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..84481637655 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-method.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-method.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..102d4161a36 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..124c278017e 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..587f30e4074 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-print.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-print.exp
> @@ -17,6 +17,8 @@ load_lib compile-support.exp
>   
>   standard_testfile
>   
> +require is_c_compiler_gcc
> +
>   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..92c88fc0887 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
> @@ -21,6 +21,8 @@ standard_testfile .cc
>   
>   require allow_cplus_tests
>   
> +require is_c_compiler_gcc
> +
>   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..c8a40ada7f3 100644
> --- a/gdb/testsuite/gdb.compile/compile-cplus.exp
> +++ b/gdb/testsuite/gdb.compile/compile-cplus.exp
> @@ -17,6 +17,8 @@ load_lib compile-support.exp
>   
>   standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
>   
> +require is_c_compiler_gcc
> +
>   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..c50228d2c94 100644
> --- a/gdb/testsuite/gdb.compile/compile-ifunc.exp
> +++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp
> @@ -19,6 +19,8 @@ require allow_ifunc_tests
>   
>   standard_testfile
>   
> +require is_c_compiler_gcc
> +
>   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..bbc221d7c0a 100644
> --- a/gdb/testsuite/gdb.compile/compile-ops.exp
> +++ b/gdb/testsuite/gdb.compile/compile-ops.exp
> @@ -22,6 +22,8 @@ load_lib dwarf.exp
>   # This test can only be run on targets which support DWARF-2 and use gas.
>   require dwarf2_support
>   
> +require is_c_compiler_gcc
> +
>   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..bbc68a0f09f 100644
> --- a/gdb/testsuite/gdb.compile/compile-print.exp
> +++ b/gdb/testsuite/gdb.compile/compile-print.exp
> @@ -17,6 +17,8 @@ load_lib compile-support.exp
>   
>   standard_testfile
>   
> +require is_c_compiler_gcc
> +
>   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..eed31a7a626 100644
> --- a/gdb/testsuite/gdb.compile/compile-setjmp.exp
> +++ b/gdb/testsuite/gdb.compile/compile-setjmp.exp
> @@ -17,6 +17,8 @@ load_lib compile-support.exp
>   
>   standard_testfile .c compile-setjmp-mod.c
>   
> +require is_c_compiler_gcc
> +
>   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..7647111de52 100644
> --- a/gdb/testsuite/gdb.compile/compile-tls.exp
> +++ b/gdb/testsuite/gdb.compile/compile-tls.exp
> @@ -17,6 +17,8 @@ load_lib compile-support.exp
>   
>   standard_testfile .c
>   
> +require is_c_compiler_gcc
> +
>   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..38818d2d255 100644
> --- a/gdb/testsuite/gdb.compile/compile.exp
> +++ b/gdb/testsuite/gdb.compile/compile.exp
> @@ -17,10 +17,8 @@ load_lib compile-support.exp
>   
>   standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c
>   
> -set options {}
> -if [test_compiler_info gcc*] {
> -    lappend options additional_flags=-g3
> -}
> +require is_c_compiler_gcc
> +set options {additional_flags=-g3}
>   
>   if { ![is_x86_64_m64_target] } {
>       verbose "Skipping x86_64 LOC_CONST test."



More information about the Gdb-patches mailing list