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]

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


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;


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