From patchwork Mon May 18 15:01:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Lawrence X-Patchwork-Id: 473416 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 683FF1401B5 for ; Tue, 19 May 2015 01:01: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=oUa7KUW9; 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=Ljb3wuWR4k2GpRLcHIXtxo1Z8wIasM3KeM1ISftjxlQ stlHiSATbbxo+E8PriY9AGKou8A6l3kmR/NFnVTVap+4zDk/gObWrZD7i1+cnDfB 3hSHxHi5dmJAXI7A4zcqVp1CY6nYyyXyXETbZYC78Xo6Mx6yuw0bpcVbMBvDRxiE = 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=Adf7SIXseg1OvB2s7OmNJgFTggc=; b=oUa7KUW9SjLFXvrzc r8BFpSM+vglxxnJANjiRLTTAj+XlcO2qNH1yGpRGfZ4NC0MPiAuIm0Uc+eVUG+fs t3Vv729+TOdEtgM8l6Ip4QzsO2pugNN0rtHjtMcjsfd+FCOuZ9x2rQeeWJAxOJlz osmuwN/ZDVnXNOtIPJrNX2nTXY= Received: (qmail 126050 invoked by alias); 18 May 2015 15:01:29 -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 126040 invoked by uid 89); 18 May 2015 15:01:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 May 2015 15:01:24 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-5.uk.mimecast.lan; Mon, 18 May 2015 16:01:20 +0100 Received: from [10.2.207.65] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 18 May 2015 16:01:20 +0100 Message-ID: <5559FEBF.7000804@arm.com> Date: Mon, 18 May 2015 16:01:19 +0100 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Mike Stump Subject: [PATCH][Testsuite] Disable tests with dg-require-fork for simulated targets X-MC-Unique: hacVhW4CQuGErdD9xSF-KA-1 X-IsSubscribed: yes Simulators such as qemu report the presence of fork (it's in glibc) but generally do not support synchronization primitives between threads, so any tests using fork are unreliable. This patch disables the subset of such tests that identify themselves using dg-require-fork. At present, such tests are limited to (a) gcc.dg/torture/ftrapv-1.c. and (b) some tests in the 27_io section of the libstdc++ testsuite, listed below. Further patches can add dg-require-fork to the many other tests that call fork(). Cross-tested on aarch64-none-linux-gnu using qemu, with these tests becoming UNSUPPORTED: (gcc) gcc.dg/torture/ftrapv-1.c (libstdc++) 27_io/basic_filebuf/close/char/4879.cc 27_io/basic_filebuf/close/char/9964.cc 27_io/basic_filebuf/seekoff/char/26777.cc 27_io/basic_filebuf/showmanyc/char/9533-1.cc 27_io/basic_filebuf/underflow/char/10097.cc 27_io/objects/char/7.cc 27_io/objects/char/9661-1.cc 27_io/objects/wchar_t/7.cc 27_io/objects/wchar_t/9661-1.cc Thoughts? Is this patch OK for trunk? Cheers, Alan gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_fork_available): Return 0 if running on simulator. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f632d00..0ffd35c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1781,6 +1781,10 @@ proc check_function_available { function } { # Returns true iff "fork" is available on the target system. proc check_fork_available {} { + if { [check_effective_target_simulator] } { + # Most simulators do not properly support multithreading + return 0 + } return [check_function_available "fork"] }