This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] fix PR testsuite/29007, gcc.dg/long-long-cst1.c fails


There are two problems with this testcase, one is that we don't return 0
on success so the test would fail on some targets.  Two is that for
64bit targets this testcase would fail because we would warn about
casting from a pointer type to an integer type that are different sizes.

Committed after a test that the testcase now passes.

Thanks,
Andrew Pinski

2006-09-10  Andrew Pinski  <pinskia@physics.uc.edu>

        * gcc.dg/long-long-cst1.c (t): Add cast to
        __SIZE_TYPE__ before casting to int.
        (main): Return 0 on success.

Index: gcc.dg/long-long-cst1.c
===================================================================
--- gcc.dg/long-long-cst1.c	(revision 116830)
+++ gcc.dg/long-long-cst1.c	(working copy)
@@ -7,11 +7,12 @@ extern void abort();
 struct st{
   int _mark;
 };
-unsigned long long t = ((int)&(((struct st*)16)->_mark) - 32);
+unsigned long long t = ((int)(__SIZE_TYPE__)&(((struct st*)16)->_mark) - 32);
 
 int main()
 {
   if (t != (unsigned long long)(int)-16)
     abort ();
+  return 0;
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]