public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix for char16_t/char32_t conversion tests on 64-bit archs
@ 2008-04-21 14:13 Kris Van Hees
  2008-04-22  1:53 ` Janis Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Kris Van Hees @ 2008-04-21 14:13 UTC (permalink / raw)
  To: dominiq; +Cc: pinskia, hjl.tools, gcc-patches

Oracle has a full copyright assignment in place with the FSF.

This patch addresses the problem reported in PR testsuite/35981:

	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35981

The tests for conversion did not appropriately consider 64-bit platforms,
nor did it include testing for 'long long'.  This patch addresses both
problems.

ChangeLog entries:
------------------
gcc/testsuite/ChangeLog:
2008-04-20  Kris Van Hees <kris.van.hees@oracle.com>

	PR testsuite/35981
	* g++.dg/ext/utf-cvt.C: Handle 64-bit platforms correctly.
	Add tests for 'long long'.
	* gcc.dg/utf-cvt.c: Handle 64-bit platforms correctly.
	Add tests for 'long long'.

Bootstrapping and testing:
--------------------------
The source tree was built on the following platforms (target == host):

	i686-linux
	x86_64-linux

Builds were done for both the unpatched tree and the patched tree, and
testsuite (make -k check) summary results were verified to be identical,
except for the added tests in the patched tree.  This was done to ensure
that the patch does not introduce regressions.

Index: gcc/testsuite/gcc.dg/utf-cvt.c
===================================================================
--- gcc/testsuite/gcc.dg/utf-cvt.c	(revision 134495)
+++ gcc/testsuite/gcc.dg/utf-cvt.c	(working copy)
@@ -3,8 +3,8 @@
 /* { dg-do compile } */
 /* { dg-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */
 
-typedef unsigned short	char16_t;
-typedef unsigned int	char32_t;
+typedef short unsigned int	char16_t;
+typedef unsigned int		char32_t;
 
 extern void f_c (char);
 extern void fsc (signed char);
@@ -18,14 +18,17 @@ extern void fui (unsigned int);
 extern void f_l (long);
 extern void fsl (signed long);
 extern void ful (unsigned long);
+extern void f_ll (long long);
+extern void fsll (signed long long);
+extern void full (unsigned long long);
 
 void m (char16_t c0, char32_t c1)
 {
-    f_c (c0);				/* { dg-warning "alter its value" } */
-    fsc (c0);				/* { dg-warning "alter its value" } */
-    fuc (c0);				/* { dg-warning "alter its value" } */
-    f_s (c0);				/* { dg-warning "change the sign" } */
-    fss (c0);				/* { dg-warning "change the sign" } */
+    f_c (c0);	/* { dg-warning "alter its value" } */
+    fsc (c0);	/* { dg-warning "alter its value" } */
+    fuc (c0);	/* { dg-warning "alter its value" } */
+    f_s (c0);	/* { dg-warning "change the sign" } */
+    fss (c0);	/* { dg-warning "change the sign" } */
     fus (c0);
     f_i (c0);
     fsi (c0);
@@ -33,17 +36,23 @@ void m (char16_t c0, char32_t c1)
     f_l (c0);
     fsl (c0);
     ful (c0);
+    f_ll (c0);
+    fsll (c0);
+    full (c0);
 
-    f_c (c1);				/* { dg-warning "alter its value" } */
-    fsc (c1);				/* { dg-warning "alter its value" } */
-    fuc (c1);				/* { dg-warning "alter its value" } */
-    f_s (c1);				/* { dg-warning "alter its value" } */
-    fss (c1);				/* { dg-warning "alter its value" } */
-    fus (c1);				/* { dg-warning "alter its value" } */
-    f_i (c1);				/* { dg-warning "change the sign" } */
-    fsi (c1);				/* { dg-warning "change the sign" } */
+    f_c (c1);	/* { dg-warning "alter its value" } */
+    fsc (c1);	/* { dg-warning "alter its value" } */
+    fuc (c1);	/* { dg-warning "alter its value" } */
+    f_s (c1);	/* { dg-warning "alter its value" } */
+    fss (c1);	/* { dg-warning "alter its value" } */
+    fus (c1);	/* { dg-warning "alter its value" } */
+    f_i (c1);	/* { dg-warning "change the sign" } */
+    fsi (c1);	/* { dg-warning "change the sign" } */
     fui (c1);
-    f_l (c1);				/* { dg-warning "change the sign" } */
-    fsl (c1);				/* { dg-warning "change the sign" } */
+    f_l (c1);	/* { dg-warning "change the sign" "" { target { ilp32 } } } */
+    fsl (c1);	/* { dg-warning "change the sign" "" { target { ilp32 } } } */
     ful (c1);
+    f_ll (c1);
+    fsll (c1);
+    full (c1);
 }
Index: gcc/testsuite/g++.dg/ext/utf-cvt.C
===================================================================
--- gcc/testsuite/g++.dg/ext/utf-cvt.C	(revision 134495)
+++ gcc/testsuite/g++.dg/ext/utf-cvt.C	(working copy)
@@ -15,14 +15,17 @@ extern void fui (unsigned int);
 extern void f_l (long);
 extern void fsl (signed long);
 extern void ful (unsigned long);
+extern void f_ll (long long);
+extern void fsll (signed long long);
+extern void full (unsigned long long);
 
 void m(char16_t c0, char32_t c1)
 {
-    f_c (c0);			/* { dg-warning "alter its value" } */
-    fsc (c0);			/* { dg-warning "alter its value" } */
-    fuc (c0);			/* { dg-warning "alter its value" } */
-    f_s (c0);			/* { dg-warning "change the sign" } */
-    fss (c0);			/* { dg-warning "change the sign" } */
+    f_c (c0);	/* { dg-warning "alter its value" } */
+    fsc (c0);	/* { dg-warning "alter its value" } */
+    fuc (c0);	/* { dg-warning "alter its value" } */
+    f_s (c0);	/* { dg-warning "change the sign" } */
+    fss (c0);	/* { dg-warning "change the sign" } */
     fus (c0);
     f_i (c0);
     fsi (c0);
@@ -30,17 +33,23 @@ void m(char16_t c0, char32_t c1)
     f_l (c0);
     fsl (c0);
     ful (c0);
+    f_ll (c0);
+    fsll (c0);
+    full (c0);
 
-    f_c (c1);			/* { dg-warning "alter its value" } */
-    fsc (c1);			/* { dg-warning "alter its value" } */
-    fuc (c1);			/* { dg-warning "alter its value" } */
-    f_s (c1);			/* { dg-warning "alter its value" } */
-    fss (c1);			/* { dg-warning "alter its value" } */
-    fus (c1);			/* { dg-warning "alter its value" } */
-    f_i (c1);			/* { dg-warning "change the sign" } */
-    fsi (c1);			/* { dg-warning "change the sign" } */
+    f_c (c1);	/* { dg-warning "alter its value" } */
+    fsc (c1);	/* { dg-warning "alter its value" } */
+    fuc (c1);	/* { dg-warning "alter its value" } */
+    f_s (c1);	/* { dg-warning "alter its value" } */
+    fss (c1);	/* { dg-warning "alter its value" } */
+    fus (c1);	/* { dg-warning "alter its value" } */
+    f_i (c1);	/* { dg-warning "change the sign" } */
+    fsi (c1);	/* { dg-warning "change the sign" } */
     fui (c1);
-    f_l (c1);			/* { dg-warning "change the sign" } */
-    fsl (c1);			/* { dg-warning "change the sign" } */
+    f_l (c1);	/* { dg-warning "change the sign" "" { target { ilp32 } } } */
+    fsl (c1);	/* { dg-warning "change the sign" "" { target { ilp32 } } } */
     ful (c1);
+    f_ll (c1);
+    fsll (c1);
+    full (c1);
 }

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

* Re: [PATCH] Fix for char16_t/char32_t conversion tests on 64-bit  archs
  2008-04-21 14:13 [PATCH] Fix for char16_t/char32_t conversion tests on 64-bit archs Kris Van Hees
@ 2008-04-22  1:53 ` Janis Johnson
  2008-04-22  6:54   ` Kris Van Hees
  0 siblings, 1 reply; 4+ messages in thread
From: Janis Johnson @ 2008-04-22  1:53 UTC (permalink / raw)
  To: Kris Van Hees; +Cc: dominiq, pinskia, hjl.tools, gcc-patches

On Mon, 2008-04-21 at 07:06 -0400, Kris Van Hees wrote:
> Oracle has a full copyright assignment in place with the FSF.
> 
> This patch addresses the problem reported in PR testsuite/35981:
> 
> 	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35981
> 
> The tests for conversion did not appropriately consider 64-bit platforms,
> nor did it include testing for 'long long'.  This patch addresses both
> problems.
> 
> ChangeLog entries:
> ------------------
> gcc/testsuite/ChangeLog:
> 2008-04-20  Kris Van Hees <kris.van.hees@oracle.com>
> 
> 	PR testsuite/35981
> 	* g++.dg/ext/utf-cvt.C: Handle 64-bit platforms correctly.
> 	Add tests for 'long long'.
> 	* gcc.dg/utf-cvt.c: Handle 64-bit platforms correctly.
> 	Add tests for 'long long'.

This is OK.  Do you have write access yet?

Janis

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

* Re: [PATCH] Fix for char16_t/char32_t conversion tests on 64-bit  archs
  2008-04-22  1:53 ` Janis Johnson
@ 2008-04-22  6:54   ` Kris Van Hees
  2008-04-22 19:43     ` Janis Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Kris Van Hees @ 2008-04-22  6:54 UTC (permalink / raw)
  To: Janis Johnson; +Cc: Kris Van Hees, dominiq, pinskia, hjl.tools, gcc-patches

On Mon, Apr 21, 2008 at 04:04:39PM -0700, Janis Johnson wrote:
> On Mon, 2008-04-21 at 07:06 -0400, Kris Van Hees wrote:
> > Oracle has a full copyright assignment in place with the FSF.
> > 
> > This patch addresses the problem reported in PR testsuite/35981:
> > 
> > 	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35981
> > 
> > The tests for conversion did not appropriately consider 64-bit platforms,
> > nor did it include testing for 'long long'.  This patch addresses both
> > problems.
> > 
> > ChangeLog entries:
> > ------------------
> > gcc/testsuite/ChangeLog:
> > 2008-04-20  Kris Van Hees <kris.van.hees@oracle.com>
> > 
> > 	PR testsuite/35981
> > 	* g++.dg/ext/utf-cvt.C: Handle 64-bit platforms correctly.
> > 	Add tests for 'long long'.
> > 	* gcc.dg/utf-cvt.c: Handle 64-bit platforms correctly.
> > 	Add tests for 'long long'.
> 
> This is OK.  Do you have write access yet?

Not yet :(

	Kris

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

* Re: [PATCH] Fix for char16_t/char32_t conversion tests on 64-bit  archs
  2008-04-22  6:54   ` Kris Van Hees
@ 2008-04-22 19:43     ` Janis Johnson
  0 siblings, 0 replies; 4+ messages in thread
From: Janis Johnson @ 2008-04-22 19:43 UTC (permalink / raw)
  To: Kris Van Hees; +Cc: dominiq, pinskia, hjl.tools, gcc-patches

On Mon, 2008-04-21 at 21:11 -0400, Kris Van Hees wrote:
> On Mon, Apr 21, 2008 at 04:04:39PM -0700, Janis Johnson wrote:
> > On Mon, 2008-04-21 at 07:06 -0400, Kris Van Hees wrote:
> > > 2008-04-20  Kris Van Hees <kris.van.hees@oracle.com>
> > > 
> > > 	PR testsuite/35981
> > > 	* g++.dg/ext/utf-cvt.C: Handle 64-bit platforms correctly.
> > > 	Add tests for 'long long'.
> > > 	* gcc.dg/utf-cvt.c: Handle 64-bit platforms correctly.
> > > 	Add tests for 'long long'.
> > 
> > This is OK.  Do you have write access yet?
> 
> Not yet :(

I checked it in.

Janis

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

end of thread, other threads:[~2008-04-22 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-21 14:13 [PATCH] Fix for char16_t/char32_t conversion tests on 64-bit archs Kris Van Hees
2008-04-22  1:53 ` Janis Johnson
2008-04-22  6:54   ` Kris Van Hees
2008-04-22 19:43     ` Janis Johnson

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