From patchwork Tue Mar 4 06:15:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 25654 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 01F212066C for ; Tue, 4 Mar 2014 06:59:44 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id g12sf25012829oah.3 for ; Mon, 03 Mar 2014 22:59:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=miDp5eDFXqxu93FJdgQPJAcWYNkyRKZbmdRTLkCoHC8=; b=j+Ji+hng9RfED8g4qnvMraoeWRSlMYP+GpmbschvGpItMQK/GDktdlU/EJU8h09VaK ubS1rDCIocphAR0GyxvgvjOUYb2VH/bTd+QOMKR4XEDoLgOnsp9SEFzP22vXe5TVdVlV oDFw7lo/k0n3hnmr42/+WNwXBNZuxWj2rv1TEbQ+VNBsPoZrH8uYc/q2w+Zj0/DqVuAf rxOyE+UlV3IUnb/ouTIrXSv7ZIEGrLjvHnoxzjSUObxmXy5HCtwtWBhJu7OtNA/RUYWR t56+H8ElHK9JRJZ5GRs4xGLApCpJx1/QSoQVMkIDBArUhhv7r6+Mej656V2jTmklZ2r0 diKg== X-Gm-Message-State: ALoCoQkrw3HR3Me+QZJ7k9K22vuKC+dNJU1HewCxZwXUFrqg21iOhcS5+9JulPqarCi8DID/8ii5 X-Received: by 10.50.176.229 with SMTP id cl5mr675082igc.3.1393916384256; Mon, 03 Mar 2014 22:59:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls2441781qgc.56.gmail; Mon, 03 Mar 2014 22:59:44 -0800 (PST) X-Received: by 10.220.136.6 with SMTP id p6mr20099431vct.9.1393916384172; Mon, 03 Mar 2014 22:59:44 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id p9si4317238vdv.70.2014.03.03.22.59.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 22:59:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so4180806veb.20 for ; Mon, 03 Mar 2014 22:59:44 -0800 (PST) X-Received: by 10.58.95.161 with SMTP id dl1mr2378veb.21.1393916384095; Mon, 03 Mar 2014 22:59:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp106853vcs; Mon, 3 Mar 2014 22:59:43 -0800 (PST) X-Received: by 10.140.90.80 with SMTP id w74mr7662518qgd.96.1393916383687; Mon, 03 Mar 2014 22:59:43 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i35si7380714qge.49.2014.03.03.22.59.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Mar 2014 22:59:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:43340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKinF-0001kO-9s for patch@linaro.org; Tue, 04 Mar 2014 01:25:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKimN-0001Av-6C for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:24:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKimF-000499-0h for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:24:39 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:49371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKimE-00048q-PI; Tue, 04 Mar 2014 01:24:30 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 356F84084F; Tue, 4 Mar 2014 10:24:30 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 53A3066E; Tue, 4 Mar 2014 10:16:05 +0400 (MSK) Received: (nullmailer pid 16584 invoked by uid 1000); Tue, 04 Mar 2014 06:16:03 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 4 Mar 2014 10:15:55 +0400 Message-Id: <1393913761-16516-8-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Subject: [Qemu-devel] [PULL 07/13] tests/test-int128: Don't use __noclone__ attribute on clang X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell clang doesn't support the __noclone__ attribute and emits a warning about it. Fortunately clang also implements a mechanism for asking if a particular attribute is implemented; use it. We assume that if the compiler doesn't support __has_attribute() then it must be GCC and must support __noclone__. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- tests/test-int128.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/test-int128.c b/tests/test-int128.c index 5aca032..0772ef7 100644 --- a/tests/test-int128.c +++ b/tests/test-int128.c @@ -11,6 +11,19 @@ #include "qemu/int128.h" #include "qemu/osdep.h" +/* clang doesn't support __noclone__ but it does have a mechanism for + * telling us this. We assume that if we don't have __has_attribute() + * then this is GCC and that GCC always supports __noclone__. + */ +#if defined(__has_attribute) +#if !__has_attribute(__noclone__) +#define ATTRIBUTE_NOCLONE +#endif +#endif +#ifndef ATTRIBUTE_NOCLONE +#define ATTRIBUTE_NOCLONE __attribute__((__noclone__)) +#endif + static uint32_t tests[8] = { 0x00000000, 0x00000001, 0x7FFFFFFE, 0x7FFFFFFF, 0x80000000, 0x80000001, 0xFFFFFFFE, 0xFFFFFFFF, @@ -164,7 +177,7 @@ static void test_gt(void) /* Make sure to test undefined behavior at runtime! */ -static void __attribute__((__noinline__, __noclone__)) +static void __attribute__((__noinline__)) ATTRIBUTE_NOCLONE test_rshift_one(uint32_t x, int n, uint64_t h, uint64_t l) { Int128 a = expand(x);