public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [OB PATCH][gdb/testsuite] Make noclone conditional in vla-optimized-out.c
@ 2018-07-20 15:05 Tom de Vries
  2018-07-25 19:19 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2018-07-20 15:05 UTC (permalink / raw)
  To: gdb-patches

Hi,

Make the noclone attribute on f1 in vla-optimized-out.c conditional.  This
makes the test-case by default identical to
gcc/testsuite/gcc.dg/guality/vla-1.c.

Tested on x86_64-linux.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Make noclone conditional in vla-optimized-out.c

2018-07-20  Tom de Vries  <tdevries@suse.de>

	* gdb.base/vla-optimized-out.c: Make noclone attribute conditional on
	NOCLONE macro.
	* gdb.base/vla-optimized-out.exp: Use additional_flags -DNOCLONE.

---
 gdb/testsuite/gdb.base/vla-optimized-out.c   | 7 ++++++-
 gdb/testsuite/gdb.base/vla-optimized-out.exp | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.c b/gdb/testsuite/gdb.base/vla-optimized-out.c
index 913e8ea867..ec0a6fdd80 100644
--- a/gdb/testsuite/gdb.base/vla-optimized-out.c
+++ b/gdb/testsuite/gdb.base/vla-optimized-out.c
@@ -15,7 +15,12 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-int __attribute__((noinline, noclone))
+int
+#ifdef NOCLONE
+__attribute__((noinline, noclone))
+#else
+__attribute__((noinline))
+#endif
 f1 (int i)
 {
   char a[i + 1];
diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.exp b/gdb/testsuite/gdb.base/vla-optimized-out.exp
index 39abb795c8..b27569ed1e 100644
--- a/gdb/testsuite/gdb.base/vla-optimized-out.exp
+++ b/gdb/testsuite/gdb.base/vla-optimized-out.exp
@@ -18,7 +18,7 @@
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
-	  {debug optimize=-O1}] } {
+	  {debug optimize=-O1 additional_flags=-DNOCLONE}] } {
     return -1
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OB PATCH][gdb/testsuite] Make noclone conditional in vla-optimized-out.c
  2018-07-20 15:05 [OB PATCH][gdb/testsuite] Make noclone conditional in vla-optimized-out.c Tom de Vries
@ 2018-07-25 19:19 ` Tom Tromey
  2018-07-26  8:33   ` Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2018-07-25 19:19 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> Hi,
Tom> Make the noclone attribute on f1 in vla-optimized-out.c conditional.  This
Tom> makes the test-case by default identical to
Tom> gcc/testsuite/gcc.dg/guality/vla-1.c.

Tom> Tested on x86_64-linux.

Tom> OK for trunk?

I think this was included in a different patch of yours?
Anyway, it is ok, thank you.

It seems like it would be good to mention the GCC file in one of these
files.  If you want to add a comment to that effect, it is pre-approved.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OB PATCH][gdb/testsuite] Make noclone conditional in vla-optimized-out.c
  2018-07-25 19:19 ` Tom Tromey
@ 2018-07-26  8:33   ` Tom de Vries
  0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2018-07-26  8:33 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Wed, Jul 25, 2018 at 01:18:43PM -0600, Tom Tromey wrote:
> >>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> Hi,
> Tom> Make the noclone attribute on f1 in vla-optimized-out.c conditional.  This
> Tom> makes the test-case by default identical to
> Tom> gcc/testsuite/gcc.dg/guality/vla-1.c.
> 
> Tom> Tested on x86_64-linux.
> 
> Tom> OK for trunk?
> 
> I think this was included in a different patch of yours?

Right, in "[gdb/exp] Fix exception when printing optimized out vla".

> Anyway, it is ok, thank you.
> 
> It seems like it would be good to mention the GCC file in one of these
> files.  If you want to add a comment to that effect, it is pre-approved.
> 

Committed as below.

Thanks,
- Tom

2018-07-26  Tom de Vries  <tdevries@suse.de>

	* gdb.base/vla-optimized-out.c: Add comment about origin of test-case.

[gdb/testsuite] Add comment in gdb.base/vla-optimized-out.c

---
 gdb/testsuite/gdb.base/vla-optimized-out.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.c b/gdb/testsuite/gdb.base/vla-optimized-out.c
index ec0a6fdd80..72dfe99d3d 100644
--- a/gdb/testsuite/gdb.base/vla-optimized-out.c
+++ b/gdb/testsuite/gdb.base/vla-optimized-out.c
@@ -15,6 +15,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+/* The version of this test-case with f1 tagged with noinline only is equivalent
+   to gcc/testsuite/gcc.dg/guality/vla-1.c.  */
+
 int
 #ifdef NOCLONE
 __attribute__((noinline, noclone))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-26  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20 15:05 [OB PATCH][gdb/testsuite] Make noclone conditional in vla-optimized-out.c Tom de Vries
2018-07-25 19:19 ` Tom Tromey
2018-07-26  8:33   ` Tom de Vries

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).