diff mbox

[testsuite] Fix a few test cases

Message ID 548B441D.6000101@qnx.com
State New
Headers show

Commit Message

Ryan Mansfield Dec. 12, 2014, 7:38 p.m. UTC
Hi,

Here are a few test tweaks. In 921202-1.c, if STACK_SIZE is used then 
VLEN will blow the stack with 64bit longs. e.g. if STACK_SIZE == 512K 
then 3 arrays of 32767 longs means at a minimum 767K of stack will be 
used at -O0. In pr51447.c, the rbx global register is clobbering the rbx 
of main's caller, which can cause test case crashes on return.

2014-12-12  Ryan Mansfield  <rmansfield@qnx.com>

         * gcc.c-torture/execute/921202-1.c: Adjust VLEN.
         * gcc.c-torture/execute/pr51447.c: Restore rbx for x86-64.
         * gcc.dg/cpp/trad/include.c: Exclude QNX targets.

OK?

Regards,

Ryan Mansfield

Comments

Mike Stump Dec. 12, 2014, 9:29 p.m. UTC | #1
On Dec 12, 2014, at 11:38 AM, Ryan Mansfield <RMansfield@qnx.com> wrote:
> 
> Here are a few test tweaks. In 921202-1.c, if STACK_SIZE is used then VLEN will blow the stack with 64bit longs. e.g. if STACK_SIZE == 512K then 3 arrays of 32767 longs means at a minimum 767K of stack will be used at -O0. In pr51447.c, the rbx global register is clobbering the rbx of main's caller, which can cause test case crashes on return.
> 
> 2014-12-12  Ryan Mansfield  <rmansfield@qnx.com>
> 
>        * gcc.c-torture/execute/921202-1.c: Adjust VLEN.
>        * gcc.c-torture/execute/pr51447.c: Restore rbx for x86-64.
>        * gcc.dg/cpp/trad/include.c: Exclude QNX targets.
> 
> OK?

Ok for first and third part.  The second one, I would like an rbx/x86_64 person to review.
Jeff Law Jan. 5, 2015, 9:40 p.m. UTC | #2
On 12/12/14 12:38, Ryan Mansfield wrote:
> Hi,
>
> Here are a few test tweaks. In 921202-1.c, if STACK_SIZE is used then
> VLEN will blow the stack with 64bit longs. e.g. if STACK_SIZE == 512K
> then 3 arrays of 32767 longs means at a minimum 767K of stack will be
> used at -O0. In pr51447.c, the rbx global register is clobbering the rbx
> of main's caller, which can cause test case crashes on return.
>
> 2014-12-12  Ryan Mansfield  <rmansfield@qnx.com>
>
>          * gcc.c-torture/execute/921202-1.c: Adjust VLEN.
>          * gcc.c-torture/execute/pr51447.c: Restore rbx for x86-64.
>          * gcc.dg/cpp/trad/include.c: Exclude QNX targets.
OK for the trunk.  Please install.

Thanks,
Jeff
diff mbox

Patch

Index: gcc/testsuite/gcc.c-torture/execute/921202-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/921202-1.c	(revision 218685)
+++ gcc/testsuite/gcc.c-torture/execute/921202-1.c	(working copy)
@@ -2,7 +2,7 @@ 
 #ifndef STACK_SIZE
 #define	VLEN	2055
 #else
-#define VLEN ((STACK_SIZE/16) - 1)
+#define VLEN ((STACK_SIZE/32) - 1)
 #endif
 main ()
 {
Index: gcc/testsuite/gcc.c-torture/execute/pr51447.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/pr51447.c	(revision 218685)
+++ gcc/testsuite/gcc.c-torture/execute/pr51447.c	(working copy)
@@ -14,6 +14,10 @@ 
 main (void)
 {
   __label__ nonlocal_lab;
+#ifdef __x86_64__
+  void *rbx __asm ("rbx");
+  void *saved_rbx = rbx;
+#endif
   __attribute__((noinline, noclone)) void
     bar (void *func)
       {
@@ -21,9 +25,15 @@ 
 	goto nonlocal_lab;
       }
   bar (&&nonlocal_lab);
+#ifdef __x86_64__
+  rbx = saved_rbx;
+#endif
   return 1;
 nonlocal_lab:
   if (ptr != &&nonlocal_lab)
     abort ();
+#ifdef __x86_64__
+  rbx = saved_rbx;
+#endif
   return 0;
 }
Index: gcc/testsuite/gcc.dg/cpp/trad/include.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/trad/include.c	(revision 218685)
+++ gcc/testsuite/gcc.dg/cpp/trad/include.c	(working copy)
@@ -1,11 +1,11 @@ 
 /* Copyright (c) 2002 Free Software Foundation Inc.  */
 
-/* Test that macros are not expanded in the <> quotes of #inlcude.  */
+/* Test that macros are not expanded in the <> quotes of #include.  */
 
 /* vxWorksCommon.h uses the "#" operator to construct the name of an
    include file, thus making the file incompatible with -traditional-cpp.
    Newlib uses ## when including stdlib.h as of 2007-09-07.  */
-/* { dg-do preprocess { target { { ! vxworks_kernel } && { ! newlib } } } } */
+/* { dg-do preprocess { target { { ! vxworks_kernel } && { ! newlib } && { ! *-*-qnx* }} } } */
 
 #define __STDC__ 1		/* Stop complaints about non-ISO compilers.  */
 #define stdlib 1