* [PATCH] Fix gdb.cp/step-and-next-inline.exp with Clang
@ 2020-11-02 19:05 Gary Benson
2020-11-08 10:14 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Gary Benson @ 2020-11-02 19:05 UTC (permalink / raw)
To: gdb-patches
Hi all,
Clang fails to compile gdb.cp/step-and-next-inline.cc, with the
following error:
clang-12: error: unknown argument: '-gstatement-frontiers'
compiler exited with status 1
This commit fixes the testcase by only passing -gstatement-frontiers
when building with GCC. This commit also alters two checks marked as
known failures, to mark them as known failures only when built using
GCC.
Checked on Fedora 32 x86_64, with GCC and Clang. Ok to commit?
Cheers,
Gary
---
gdb/testsuite/ChangeLog:
* gdb.cp/step-and-next-inline.exp: Only require
-gstatement-frontiers when building with GCC.
Only setup KFAIL's for GCC issues when using
a GCC-built executable.
---
gdb/testsuite/ChangeLog | 7 +++++++
gdb/testsuite/gdb.cp/step-and-next-inline.exp | 20 ++++++++++++++++----
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.exp b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
index a95e211..43a7101 100644
--- a/gdb/testsuite/gdb.cp/step-and-next-inline.exp
+++ b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
@@ -15,7 +15,12 @@
standard_testfile .cc
-if { ![supports_statement_frontiers] } {
+if [get_compiler_info "c++"] {
+ unsupported "couldn't find a valid c++ compiler"
+ return -1
+}
+
+if {[test_compiler_info gcc*] && ![supports_statement_frontiers] } {
return -1
}
@@ -31,7 +36,10 @@ proc do_test { use_header } {
return
}
- set options {c++ debug nowarnings optimize=-O2\ -gstatement-frontiers}
+ set options {c++ debug nowarnings optimize=-O2}
+ if { [supports_statement_frontiers] } {
+ lappend options -gstatement-frontiers
+ }
if { $use_header } {
lappend options additional_flags=-DUSE_NEXT_INLINE_H
set executable "$testfile-with-header"
@@ -65,14 +73,18 @@ proc do_test { use_header } {
# that some easier heuristic could be figured out). Still, it is
# not certain that the first failure wouldn't also be fixed by
# having location view support, so for now it is tagged as such.
- if {!$use_header} { setup_kfail "*-*-*" symtab/25507 }
+ if {[test_compiler_info gcc*] && !$use_header} {
+ setup_kfail "*-*-*" symtab/25507
+ }
gdb_test "next" ".*TREE_TYPE.*" "next step 1"
gdb_test "bt" "\\s*\\#0\\s+get_alias_set\[^\r\]*${srcfile}:.*" \
"not in inline 2"
gdb_test "next" ".*TREE_TYPE.*" "next step 2"
gdb_test "bt" "\\s*\\#0\\s+get_alias_set\[^\r\]*${srcfile}:.*" \
"not in inline 3"
- if {!$use_header} { setup_kfail "*-*-*" symtab/25507 }
+ if {[test_compiler_info gcc*] && !$use_header} {
+ setup_kfail "*-*-*" symtab/25507
+ }
gdb_test "next" ".*TREE_TYPE.*" "next step 3"
gdb_test "bt" "\\s*\\#0\\s+get_alias_set\[^\r\]*${srcfile}:.*" \
"not in inline 4"
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix gdb.cp/step-and-next-inline.exp with Clang
2020-11-02 19:05 [PATCH] Fix gdb.cp/step-and-next-inline.exp with Clang Gary Benson
@ 2020-11-08 10:14 ` Joel Brobecker
2020-11-10 16:09 ` [PUSHED] " Gary Benson
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2020-11-08 10:14 UTC (permalink / raw)
To: Gary Benson via Gdb-patches
Hi Gary,
> gdb/testsuite/ChangeLog:
>
> * gdb.cp/step-and-next-inline.exp: Only require
> -gstatement-frontiers when building with GCC.
> Only setup KFAIL's for GCC issues when using
> a GCC-built executable.
This looks OK to me. Please go ahead and push.
--
Joel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PUSHED] Fix gdb.cp/step-and-next-inline.exp with Clang
2020-11-08 10:14 ` Joel Brobecker
@ 2020-11-10 16:09 ` Gary Benson
0 siblings, 0 replies; 3+ messages in thread
From: Gary Benson @ 2020-11-10 16:09 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Gary Benson via Gdb-patches
Hi Joel,
Joel Brobecker wrote:
> > gdb/testsuite/ChangeLog:
> >
> > * gdb.cp/step-and-next-inline.exp: Only require
> > -gstatement-frontiers when building with GCC.
> > Only setup KFAIL's for GCC issues when using
> > a GCC-built executable.
>
> This looks OK to me. Please go ahead and push.
Thanks for reviewing this, I've pushed it now.
Cheers,
Gary
--
Gary Benson - he / him / his
Principal Software Engineer, Red Hat
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-10 16:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 19:05 [PATCH] Fix gdb.cp/step-and-next-inline.exp with Clang Gary Benson
2020-11-08 10:14 ` Joel Brobecker
2020-11-10 16:09 ` [PUSHED] " Gary Benson
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).