From patchwork Mon Aug 5 10:57:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivchenko X-Patchwork-Id: 264628 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id A32D22C0096 for ; Mon, 5 Aug 2013 20:57:32 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=g4NyPqfbHV13lCxAVJGuMByoy/giImRAknApTCWAgFgsFB HG9jH0LYZ9DUdI/x4Tdb4Sb1hfsfDExO1jp5WIeo0KWqN85pJx3dVkUJLifElwNk PS/NCIOuokJz7TWcVDvsVtssB0Q5X2/oRV0wU7jc7ll226nqYs2VEtw9AvBQU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=NTpow9eH4SoYhNlvmbC+Je2+GP0=; b=UvH3oeq3ofOvH0xVie5e 8qwqbQEJ1fwfQOyD0ijJZgRuT8Z7ewUiHDgVd9RrO6hy68NE4JyILnilzaFb8xVw hlwsJWBXOsPjr41l8aqLR2lig3gv8OcPkfVE7e7JaHLUdSppPeEoz7NqeCYd9gzQ 0kqv/GuUssBA36VjRt5w5uI= Received: (qmail 1842 invoked by alias); 5 Aug 2013 10:57:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 1811 invoked by uid 89); 5 Aug 2013 10:57:21 -0000 X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RDNS_NONE, SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mail-pb0-f45.google.com) (209.85.160.45) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 05 Aug 2013 10:57:20 +0000 Received: by mail-pb0-f45.google.com with SMTP id mc17so3194538pbc.18 for ; Mon, 05 Aug 2013 03:57:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.190.198 with SMTP id gs6mr24195573pac.49.1375700233013; Mon, 05 Aug 2013 03:57:13 -0700 (PDT) Received: by 10.68.26.130 with HTTP; Mon, 5 Aug 2013 03:57:12 -0700 (PDT) Date: Mon, 5 Aug 2013 14:57:12 +0400 Message-ID: Subject: [testsuite, Android] Add to pr56407.c From: Alexander Ivchenko To: GCC Patches , Maxim Kuvyrkov Hi, The following test case fails to compile on Android: gcc.dg/torture/pr56407.c /tmp/ccA08Isw.o:pr56407.c:function test: error: undefined reference to 'rand' collect2: error: ld returned 1 exit status Which is not surprising at all, since the testcase has only the declarations of abort() and rand() and doesn't have any headers included. The following patch adds to the test. Tested on x86_64-unknown-linux-gnu and on Android. Also I checked that the original regression appears on the fixed test. Is it OK for trunk? --Alexander diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f356d55..5c23650 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-05 Alexander Ivchenko + + * gcc.dg/torture/pr56407.c: Add include of stdlib.h. Remove + declaration of abort() and rand(). + 2013-08-04 Ed Smith-Rowland <3dw4rd@verizon.net> PR c++/58072 diff --git a/gcc/testsuite/gcc.dg/torture/pr56407.c b/gcc/testsuite/gcc.dg/torture/pr56407.c index f26fd23..5d35874 100644 --- a/gcc/testsuite/gcc.dg/torture/pr56407.c +++ b/gcc/testsuite/gcc.dg/torture/pr56407.c @@ -1,7 +1,6 @@ /* { dg-do run } */ -extern void abort(void); -extern int rand(void); +#include static void copy(int *r,int *a,int na) {