Patchwork [v3] libstdc++/47773

login
register
mail settings
Submitter Paolo Carlini
Date Feb. 17, 2011, 8:17 a.m.
Message ID <4D5CD9A6.90802@oracle.com>
Download mbox | patch
Permalink /patch/83427/
State New
Headers show

Comments

Paolo Carlini - Feb. 17, 2011, 8:17 a.m.
On 02/17/2011 04:59 AM, H.J. Lu wrote:
> On Wed, Feb 16, 2011 at 5:26 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
>   
>> Hi,
>>
>> tested x86_64-linux, committed to mainline.
>>
>> Paolo.
>>     
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47776
>
> They fail only on ia32.
>   
Grrr, last night was tired. I'm fixing the testcases with the below.

Paolo.

//////////////////////
2011-02-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/47776
	* testsuite/ext/vstring/hash/char/1.cc: Fix.
	* testsuite/ext/vstring/hash/wchar_t/1.cc: Likewise.

Patch

Index: testsuite/ext/vstring/hash/wchar_t/1.cc
===================================================================
--- testsuite/ext/vstring/hash/wchar_t/1.cc	(revision 170240)
+++ testsuite/ext/vstring/hash/wchar_t/1.cc	(working copy)
@@ -37,15 +37,14 @@ 
 
   VERIFY( mymap.size() == 2 );
 
-  map_t::const_iterator imap = mymap.begin();
- 
-  VERIFY( vstring_t(imap->first.c_str()) == L"hi" );
-  VERIFY( imap->second == 20 );
+  map_t::const_iterator imap1 = mymap.begin();
+  map_t::const_iterator imap2 = mymap.begin();
+  ++imap2;
 
-  ++imap;
-
-  VERIFY( vstring_t(imap->first.c_str()) == L"hello" );
-  VERIFY( imap->second == 10 );
+  VERIFY( ((imap1->first == L"hello" && imap1->second == 10
+	    && imap2->first == L"hi" && imap2->second == 20)
+	   || (imap1->first == L"hi" && imap1->second == 20
+	       && imap2->first == L"hello" && imap2->second == 10)) );
 }
 
 int main()
Index: testsuite/ext/vstring/hash/char/1.cc
===================================================================
--- testsuite/ext/vstring/hash/char/1.cc	(revision 170240)
+++ testsuite/ext/vstring/hash/char/1.cc	(working copy)
@@ -37,15 +37,14 @@ 
 
   VERIFY( mymap.size() == 2 );
 
-  map_t::const_iterator imap = mymap.begin();
- 
-  VERIFY( vstring_t(imap->first.c_str()) == "hi" );
-  VERIFY( imap->second == 20 );
+  map_t::const_iterator imap1 = mymap.begin();
+  map_t::const_iterator imap2 = mymap.begin();
+  ++imap2;
 
-  ++imap;
-
-  VERIFY( vstring_t(imap->first.c_str()) == "hello" );
-  VERIFY( imap->second == 10 );
+  VERIFY( ((imap1->first == "hello" && imap1->second == 10
+	    && imap2->first == "hi" && imap2->second == 20)
+	   || (imap1->first == "hi" && imap1->second == 20
+	       && imap2->first == "hello" && imap2->second == 10)) );
 }
 
 int main()