Patchwork [testsuite] : Again: Fix wrong assumption on sizeof (int)

login
register
mail settings
Submitter Georg-Johann Lay
Date Jan. 13, 2012, 9:42 a.m.
Message ID <4F0FFC8F.9070703@gjlay.de>
Download mbox | patch
Permalink /patch/135757/
State New
Headers show

Comments

Georg-Johann Lay - Jan. 13, 2012, 9:42 a.m.
This is again a test case that assumes sizeof (int) > 2 which is not true in
general.

	* g++.dg/ipa/pr51759.C: Fix assumption sizeof(int) > 2.

Ok for trunk.
Mike Stump - Jan. 13, 2012, 5:27 p.m.
On Jan 13, 2012, at 1:42 AM, Georg-Johann Lay wrote:
> This is again a test case that assumes sizeof (int) > 2 which is not true in
> general.
> 
> 	* g++.dg/ipa/pr51759.C: Fix assumption sizeof(int) > 2.
> 
> Ok for trunk.

Ok.

Patch

Index: testsuite/g++.dg/ipa/pr51759.C
===================================================================
--- testsuite/g++.dg/ipa/pr51759.C      (revision 183150)
+++ testsuite/g++.dg/ipa/pr51759.C      (working copy)
@@ -1,6 +1,10 @@ 
 /* { dg-do run } */
 /* { dg-options "-O2"  } */

+#if __SIZEOF_INT__ == 2 && __SIZEOF_LONG__ == 4
+#define unsigned unsigned long
+#endif
+
 extern "C" void abort (void);
 struct S
 {