From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17048 invoked by alias); 3 Jun 2013 11:20:21 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 17035 invoked by uid 89); 3 Jun 2013 11:20:21 -0000 X-Spam-SWARE-Status: No, score=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_RG autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 03 Jun 2013 11:20:20 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r53BKJfX010655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Jun 2013 07:20:19 -0400 Received: from [10.36.4.45] (vpn1-4-45.ams2.redhat.com [10.36.4.45]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r53BKGLU006903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Jun 2013 07:20:18 -0400 Message-ID: <51AC7BC4.9050403@redhat.com> Date: Mon, 03 Jun 2013 11:20:00 -0000 From: nick clifton User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1 MIME-Version: 1.0 To: Steve Ellcey , gdb@gcc.gnu.org Subject: Re: Simulator question about argc/argv References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00004.txt.bz2 Hi Steve, > Some new tests have been added to the GCC testsuite (cilk tests) that > check the value of argc and they expect it to be 1 if there are no > arguments to the test program (and there are none) but I am getting 0 > when I run the tests under the gnu simulator. Does anyone know why > this is? Yes - many simulators do not support passing any arguments to the program that they are simulating. So they set argc to zero when they invoke main. (They usually also set argv to NULL and envp to NULL). Tests that depend upon a non-zero argc value are, IMHO, dubious. Tests should be able to be run in an automated fashion without anything being provided to them via the command line or their environment. Cheers Nick