From patchwork Thu Nov 25 20:13:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 73118 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]) by ozlabs.org (Postfix) with SMTP id 88288B70A5 for ; Fri, 26 Nov 2010 07:13:56 +1100 (EST) Received: (qmail 3132 invoked by alias); 25 Nov 2010 20:13:48 -0000 Received: (qmail 3119 invoked by uid 22791); 25 Nov 2010 20:13:47 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Nov 2010 20:13:41 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 382AFACC; Thu, 25 Nov 2010 21:13:38 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id f4rE0yCXt+rU; Thu, 25 Nov 2010 21:13:36 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id D70C6ACB; Thu, 25 Nov 2010 21:13:35 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id oAPKDZKe010352; Thu, 25 Nov 2010 21:13:35 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [testsuite, ada] Compile gnat.dg effective-target checks with gcc_target_compile Date: Thu, 25 Nov 2010 21:13:35 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes 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 I've finally gotten around to properly test my patch to make dg-require-effective-target work with the gnat.dg testsuite. Unlike any other language, the gnat_target_compile function only works with Ada code, not invoking e.g. the C compiler for other input. I'm fixing this by explicitly calling gcc_target_compile in gnat_target_compile for *.c files. Removing dg-require-effective-target sse from loop_optimization7.adb was the right thing to do anyway, since as a compile test it's immaterial whether the assembler can handle SSE. On the other hand, sse_nolib.adb, as a run test, requires sse_runtime, as this patch adds. Tested with the appropriate runtest invocations on i386-pc-solaris2.8, where loop_optimization7.adb continues to pass, while sse_nolib.adb becomes unsupported since O/S support is missing. On i386-pc-solaris2.11, both tests pass. Ok for mainline and the 4.5 branch? Rainer 2010-11-20 Rainer Orth * lib/gnat.exp: Load gcc.exp. (gnat_target_compile): Use gcc_target_compile for *.c sources. * gnat.dg/sse_nolib.adb: Use dg-require-effective-target sse_runtime. ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University diff -r 736a64c64f6c gcc/testsuite/lib/gnat.exp --- a/gcc/testsuite/lib/gnat.exp Sun Nov 14 23:15:14 2010 +0100 +++ b/gcc/testsuite/lib/gnat.exp Sat Nov 20 11:17:15 2010 +0100 @@ -27,6 +27,7 @@ load_lib libgloss.exp load_lib prune.exp load_lib gcc-defs.exp +load_lib gcc.exp load_lib timeout.exp # @@ -132,6 +133,11 @@ global gnat_libgcc_s_path global gnat_target_current + # dg-require-effective-target tests must be compiled as C. + if [ string match "*.c" $source ] then { + return [gcc_target_compile $source $dest $type $options] + } + # If we detect a change of target, we need to recompute both # GNAT_UNDER_TEST and the appropriate RTS. if { $gnat_target_current!="[current_target_name]" } { diff -r 5fadddc44ec5 gcc/testsuite/gnat.dg/sse_nolib.adb --- a/gcc/testsuite/gnat.dg/sse_nolib.adb Tue Nov 23 12:22:55 2010 +0100 +++ b/gcc/testsuite/gnat.dg/sse_nolib.adb Thu Nov 25 21:07:38 2010 +0100 @@ -1,6 +1,6 @@ -- { dg-do run { target i?86-*-* x86_64-*-* } } -- { dg-options "-O1 -msse" } +-- { dg-require-effective-target sse_runtime } with Ada.Unchecked_Conversion; --