[committed] Allow argc to be zero in pr33572.C

Richard Sandiford rsandifo@nildram.co.uk
Fri Oct 12 17:24:00 GMT 2007


The recently-added pr33572.C test fails on those targets that (like MIPS IDT)
pass a zero argc to main.  Zero argcs are OK; the standard only requires
the argument to be nonnegative.

Applied to mainline as obvious after testing on mipsisa32-elf.

Richard


gcc/testsuite/
	* g++.dg/torture/pr33572.C (main): Allow argc to be zero.

Index: gcc/testsuite/g++.dg/torture/pr33572.C
===================================================================
--- gcc/testsuite/g++.dg/torture/pr33572.C	(revision 129268)
+++ gcc/testsuite/g++.dg/torture/pr33572.C	(working copy)
@@ -7,7 +7,7 @@ struct Foo { virtual void f() {} };
 int main(int argc, char**)
 {
 	std::auto_ptr<Foo> foo;
-	if (argc) {
+	if (argc >= 0) {
 		foo.reset(new Foo());
 	} else {
 		std::vector<int> v;



More information about the Gcc-patches mailing list