From patchwork Wed Jul 1 11:16:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 490068 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 842B21402B6 for ; Wed, 1 Jul 2015 21:16:45 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=nM9SK3yn; 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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=u4cwVnfMuAQgKwxI7Kt0D8Kgj6TfrSDnq4fRDVPypC7 gTi+p384l0iuCKTm/ltYdDHD3GkyFPVeJJd1pw5hnFWXqWo5XJulEcDk9GOPYiee mHUd2HcKrTaqO37KuDUfAIPDI+CzGtu7vdvi7JKYjE1HRo2keFki+zNtnNUlEbYw = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=xawUF/17Lsrs1FzWCOKE8k7vk80=; b=nM9SK3ynEycRIf3Xw /qIy7Ef/Caz2mNzKDCpzYMJjItKsaTgWiHMpeauipEXZn1kT+vciK3dE3ZwTaB0d /IJxc5+ffNhSLmArW5b6NyYpLVNG//fUScQLUo8bfsAAFCuA2Cyv+1eC97nEHY1R 01EC+96XAVjEBpdR/65+O+g1HM= Received: (qmail 102305 invoked by alias); 1 Jul 2015 11:16:38 -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 101470 invoked by uid 89); 1 Jul 2015 11:16:37 -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, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 01 Jul 2015 11:16:36 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47281) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZAG0H-00051Q-PK for gcc-patches@gnu.org; Wed, 01 Jul 2015 07:16:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAG0D-0005DU-5O for gcc-patches@gnu.org; Wed, 01 Jul 2015 07:16:33 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:49265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAG0C-00059i-V1 for gcc-patches@gnu.org; Wed, 01 Jul 2015 07:16:29 -0400 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 1ZAG08-0005x8-9U from Tom_deVries@mentor.com ; Wed, 01 Jul 2015 04:16:24 -0700 Received: from [127.0.0.1] (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; Wed, 1 Jul 2015 12:16:22 +0100 Message-ID: <5593CBFE.8070609@mentor.com> Date: Wed, 1 Jul 2015 13:16:14 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Thomas Schwinge CC: "gcc-patches@gnu.org" , Jakub Jelinek Subject: [gomp4, PATCH] Fix libgomp.oacc-c-c++-common/lib-3.c X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Hi, testcase libgomp.oacc-c-c++-common/lib-3.c is supposed to fail. It fails currently in two ways: - no device found, if there is no nonhost device type supported, so just host and host_nonshm - no device initialized, if there is a nonhost device type supported, f.i. nvidia The reason for the different failure modes is the usage of acc_device_not_host. Neither of the current failure modes is matches by the current dg-output: ... /* { dg-output "device \[0-9\]+\\\(\[0-9\]+\\\) is initialized" } */ ... I don't understand what this dg-output is trying to achieve. Attached patch makes sure that both current failure modes are tested and accepted. OK for gomp-4_0-branch? Thanks, - Tom Fix libgomp.oacc-c-c++-common/lib-3.c 2015-07-01 Tom de Vries * testsuite/lib/libgomp.exp (offload_targets_nonhost): New var. (check_effective_target_offload_target_nonhost_supported): New proc. * testsuite/libgomp.oacc-c-c++-common/lib-3.c: Only run if offload_target_nonhost_supported. * testsuite/libgomp.oacc-c-c++-common/lib-3b.c: New test. Copy of lib-3.c, but only run if !offload_target_nonhost_supported. --- libgomp/testsuite/lib/libgomp.exp | 13 +++++++++++++ libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c | 4 ++-- libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3b.c | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3b.c diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 6dba22b..951e043 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -38,9 +38,11 @@ load_file libgomp-test-support.exp # Populate offload_targets_s (offloading targets separated by a space), and # offload_targets_s_openacc (the same, but with OpenACC names; OpenACC spells # some of them a little differently). +set offload_targets_nonhost 0 set offload_targets_s [split $offload_targets ","] set offload_targets_s_openacc {} foreach offload_target_openacc $offload_targets_s { + set nonhost 1 switch $offload_target_openacc { intelmic { # TODO. Skip; will all FAIL because of missing @@ -50,8 +52,14 @@ foreach offload_target_openacc $offload_targets_s { nvptx { set offload_target_openacc "nvidia" } + host_nonshm { + set nonhost 0 + } } lappend offload_targets_s_openacc "$offload_target_openacc" + if { $nonhost == 1 } { + set offload_targets_nonhost 1 + } } lappend offload_targets_s_openacc "host" @@ -369,6 +377,11 @@ proc check_effective_target_offload_device { } { } ] } +proc check_effective_target_offload_target_nonhost_supported { } { + global offload_targets_nonhost + return $offload_targets_nonhost; +} + proc check_effective_target_openacc_nvidia_accel_supported { } { global offload_targets_s_openacc set res [lsearch $offload_targets_s_openacc "nvidia" ] diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c index bb76c82..2a8c437 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target { offload_target_nonhost_supported } } } */ #include @@ -12,5 +12,5 @@ main (int argc, char **argv) return 0; } -/* { dg-output "device \[0-9\]+\\\(\[0-9\]+\\\) is initialized" } */ +/* { dg-output "no device initialized" } */ /* { dg-shouldfail "" } */ diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3b.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3b.c new file mode 100644 index 0000000..f21830c --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3b.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { ! offload_target_nonhost_supported } } } */ + +#include + +int +main (int argc, char **argv) +{ + acc_init (acc_device_host); + + acc_shutdown (acc_device_not_host); + + return 0; +} + +/* { dg-output "no device found" } */ +/* { dg-shouldfail "" } */ -- 1.9.1