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]

[libstdc++, committed] fix PR65909


This patch works around a libstdc++ testsuite issue: the generated program that tests for the availability of named locales dereferences invalid pointers on targets that don't allow command-line arguments to be passed. (In particular, I ran into this with a simulator for an embedded target that produces a ton of verbose error messages when it hits an invalid memory reference.) Jonathan already approved the fix in the issue, so I've gone ahead and checked it in.

-Sandra

2015-04-27  Sandra Loosemore  <sandra@codesourcery.com>

	PR libstdc++/65909

	libstdc++-v3/
	* testsuite/lib/libstdc++.exp (check_v3_target_namedlocale):
	Make the generated test program fail gracefully if the target
	doesn't	support passing command-line arguments.
Index: libstdc++-v3/testsuite/lib/libstdc++.exp
===================================================================
--- libstdc++-v3/testsuite/lib/libstdc++.exp	(revision 222496)
+++ libstdc++-v3/testsuite/lib/libstdc++.exp	(working copy)
@@ -901,6 +901,11 @@ proc check_v3_target_namedlocale { args 
       puts $f "using namespace std;"	
       puts $f "int main (int argc, char** argv)"
       puts $f "{"
+      puts $f "  if (argc < 2)"
+      puts $f "  {"
+      puts $f "    printf(\"locale support test not supported\\n\");"
+      puts $f "    return 1;"
+      puts $f "  }"	
       puts $f "  try"	
       puts $f "  {"
       puts $f "    locale(*(argv + 1));"

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