From: Gary Benson via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] KFAIL variable-length array tests which fail with Clang
Date: Mon, 16 Nov 2020 17:17:35 +0000 [thread overview]
Message-ID: <1605547055-25778-1-git-send-email-gbenson@redhat.com> (raw)
Hi all,
Clang describes the upper bounds of variable length arrays using
a DW_AT_count attribute which references the DIE of a synthetic
variable whose value is specified using a DW_AT_location. In
some cases GDB correctly handles these, but in other cases GDB
adds an extra dereference causing the test to fail. This commit
marks these failing tests as caused by PR gdb/26905 when the
test executable was built using Clang.
Checked on Fedora 32 x86_64, with GCC and Clang. Ok to commit?
Thanks,
Gary
---
gdb/testsuite/ChangeLog:
PR gdb/26905
* gdb.base/vla-optimized-out.exp: Add KFAILs for PR gdb/26905.
* gdb.base/vla-ptr.exp: Likewise.
---
gdb/testsuite/ChangeLog | 6 ++++++
gdb/testsuite/gdb.base/vla-optimized-out.exp | 8 +++++++-
gdb/testsuite/gdb.base/vla-ptr.exp | 2 ++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.exp b/gdb/testsuite/gdb.base/vla-optimized-out.exp
index 203a82d..aaa6cd5 100644
--- a/gdb/testsuite/gdb.base/vla-optimized-out.exp
+++ b/gdb/testsuite/gdb.base/vla-optimized-out.exp
@@ -16,6 +16,7 @@
# Check whether we can determine the size of an optimized-out vla.
standard_testfile
+set using_clang [test_compiler_info clang*]
# The EXE_SUFFIX is a string appended to the name of the test binary
# to make it unique per variation.
@@ -23,7 +24,7 @@ standard_testfile
# flags used for building the test binary, and the second item is a
# pattern which matches some expected output within this proc.
proc vla_optimized_out {exe_suffix options} {
- global testfile srcfile
+ global testfile srcfile using_clang
lassign $options compile_flags sizeof_result
@@ -37,10 +38,12 @@ proc vla_optimized_out {exe_suffix options} {
return
}
+ if {$using_clang} { setup_kfail "gdb/26905" *-*-* }
gdb_test "p a" \
" = <optimized out>" \
"printed optimized out vla"
+ if {$using_clang} { setup_kfail "gdb/26905" *-*-* }
gdb_test "p sizeof (a)" \
" = ($sizeof_result)" \
"printed size of optimized out vla"
@@ -55,14 +58,17 @@ proc vla_optimized_out {exe_suffix options} {
# been removed. As such GDB can't be expected to know if the
# array contains _any_ elements at all. It seems reasonable in
# that case to reply with 'no such vector element'.
+ if {$using_clang} { setup_kfail "gdb/26905" *-*-* }
gdb_test "p a\[0\]" \
"(= <optimized out>|no such vector element)" \
"print out of range element of vla (0)"
+ if {$using_clang} { setup_kfail "gdb/26905" *-*-* }
gdb_test "p a\[6\]" \
"no such vector element" \
"print out of range element of vla (6)"
+ if {$using_clang} { setup_kfail "gdb/26905" *-*-* }
gdb_test "p a\[0xffffffff\]" \
"no such vector element" \
"print out of range element of vla (0xffffffff)"
diff --git a/gdb/testsuite/gdb.base/vla-ptr.exp b/gdb/testsuite/gdb.base/vla-ptr.exp
index 346ff00..adf1779 100644
--- a/gdb/testsuite/gdb.base/vla-ptr.exp
+++ b/gdb/testsuite/gdb.base/vla-ptr.exp
@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile
+set using_clang [test_compiler_info clang*]
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
return -1
@@ -38,4 +39,5 @@ gdb_test "print *vla_ptr" " = 2" "print *vla_ptr (bar)"
gdb_breakpoint [gdb_get_line_number "vla_func_bp"]
gdb_continue_to_breakpoint "vla_func_bp"
+if {$using_clang} { setup_kfail "gdb/26905" *-*-* }
gdb_test "print td_vla" " = \\\{4, 5, 6, 7, 8\\\}"
--
1.8.3.1
next reply other threads:[~2020-11-16 17:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 17:17 Gary Benson via Gdb-patches [this message]
2020-11-18 16:14 ` Tom Tromey
2020-11-19 22:53 ` Tom de Vries
2020-11-20 15:15 ` [PATCH][gdb/symtab] Fix gdb.base/vla-optimized-out.exp with clang Tom de Vries
2020-11-21 17:16 ` [gdb/testsuite] Add clang xfail in gdb.base/vla-ptr.exp Tom de Vries
2020-11-20 15:50 ` [PATCH] KFAIL variable-length array tests which fail with Clang Tom Tromey
2020-11-20 16:30 ` Tom de Vries
2020-11-20 16:51 ` Tom Tromey
2020-11-23 10:34 ` [PATCH][gdb/symtab] Fix gdb.base/vla-optimized-out.exp with clang Tom de Vries
2020-11-25 14:50 ` Gary Benson via Gdb-patches
2020-11-25 15:25 ` Gary Benson via Gdb-patches
2020-11-25 20:05 ` Tom de Vries
2020-11-26 10:10 ` Gary Benson via Gdb-patches
2020-11-30 12:51 ` [committed][PATCH][gdb/symtab] " Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1605547055-25778-1-git-send-email-gbenson@redhat.com \
--to=gdb-patches@sourceware.org \
--cc=gbenson@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox