From patchwork Tue Jun 23 08:18:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 487528 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A068B140082 for ; Tue, 23 Jun 2015 18:30:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=kHyyvi9Z; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=j4N3wKlPZmYBlMq2 TGPXf8EqH4rpjRYy0x09XL7VR7nV9kDUmBEMJPZTt15mREABSz3wTRZ02PpaEpl+ 8JrZRFTDRpvpNTu/wVPn2NriZD0B09GtbF9rkhn2lcuRORw6QyoUTdhack0JmZNS 6s9ERKYPyBO24d6kANALBO7dn+w= 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=9ZTDXpsXk738jLY6MhMU8N bZXfo=; b=kHyyvi9ZquqoEMXCTs2Gf3oA6bH7FJpUW8Rxgz9ZIZfB27Ir2Mb72N MS8cOC7Y5bN0r9zHjbGKqAQ68mKqkADb+W2+oY+3bBVvbbRgjujxyT6CMe3GcffU gXK9ZRtlZmiPFXhjeRA95Yfs4pkzBi8IC6pPH7EzP1fNZS4MPHh2Q= Received: (qmail 121789 invoked by alias); 23 Jun 2015 08:26:08 -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 53173 invoked by uid 89); 23 Jun 2015 08:18:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Jun 2015 08:18:47 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Z7JPn-0007Ze-2W from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Tue, 23 Jun 2015 01:18:43 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Tue, 23 Jun 2015 09:18:42 +0100 From: Thomas Schwinge To: CC: Bernd Schmidt , Nathan Sidwell Subject: [nvptx] gcc/testsuite/gcc.target/nvptx/ In-Reply-To: <53E8AE92.5010601@codesourcery.com> References: <201401242027.s0OKRF8Q027471@svr-sje-svn-01.sje.mentorg.com> <87lht31auz.fsf@schwinge.name> <878uo9tjoa.fsf@schwinge.name> <87a98kro5z.fsf@schwinge.name> <53BBEEC5.8080903@codesourcery.com> <877g3ornpj.fsf@schwinge.name> <53BBF193.6010409@codesourcery.com> <87y4w3rg4i.fsf@schwinge.name> <87mwbzqe7b.fsf@schwinge.name> <874mxnm5ah.fsf@schwinge.name> <53E8AE92.5010601@codesourcery.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Tue, 23 Jun 2015 10:18:29 +0200 Message-ID: <87twty7s8a.fsf@schwinge.name> MIME-Version: 1.0 Hi! Written and internally approved by Bernd nearly a year ago; now committed to trunk in r224822: commit 5b988b24f5e557e19242d50179aa4e3e0c3752d9 Author: tschwinge Date: Tue Jun 23 08:17:23 2015 +0000 [nvptx] gcc/testsuite/gcc.target/nvptx/ We don't claim to support "K&R C" for nvptx, but needed this corresponding functionality ("incomplete prototypes") to support the Fortran libgomp/openacc_lib.h file. gcc/testsuite/ * gcc.target/nvptx/nvptx.exp: New file. * gcc.target/nvptx/proto-1.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224822 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gcc.target/nvptx/nvptx.exp | 42 ++++++++++++++++++++++++++++++++ gcc/testsuite/gcc.target/nvptx/proto-1.c | 13 ++++++++++ 3 files changed, 60 insertions(+) Grüße, Thomas diff --git gcc/testsuite/ChangeLog gcc/testsuite/ChangeLog index d5329af..f17ae0d 100644 --- gcc/testsuite/ChangeLog +++ gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-23 Thomas Schwinge + + * gcc.target/nvptx/nvptx.exp: New file. + * gcc.target/nvptx/proto-1.c: Likewise. + 2015-06-23 Bin Cheng PR tree-optimization/66449 diff --git gcc/testsuite/gcc.target/nvptx/nvptx.exp gcc/testsuite/gcc.target/nvptx/nvptx.exp new file mode 100644 index 0000000..402c8d1 --- /dev/null +++ gcc/testsuite/gcc.target/nvptx/nvptx.exp @@ -0,0 +1,42 @@ +# Specific regression driver for nvptx. +# Copyright (C) 2015 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't a nvptx target. +if ![istarget nvptx*-*-*] then { + return +} + +# Load support procs. +load_lib gcc-dg.exp + +# If a testcase doesn't have special options, use these. +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS " -ansi -pedantic-errors" +} + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS + +# All done. +dg-finish diff --git gcc/testsuite/gcc.target/nvptx/proto-1.c gcc/testsuite/gcc.target/nvptx/proto-1.c new file mode 100644 index 0000000..5f77359 --- /dev/null +++ gcc/testsuite/gcc.target/nvptx/proto-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ + +int f(void) +{ + const int dev = 4; + + /* Check that without an explicit prototype, we deduce from call site the + signature for the (mandatory in PTX) prototype. */ + /* extern int acc_on_device_(int *); */ + /* { dg-final { scan-assembler-not "\\\.callprototype" } } */ + /* { dg-final { scan-assembler "\\\.extern \\\.func \\\(\[^,\n\r\]+\\\)acc_on_device_ \\\(\[^,\n\r\]+\\\);" } } */ + return !acc_on_device_(&dev); +}