From patchwork Wed Feb 26 23:39:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25436 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7F37320636 for ; Wed, 26 Feb 2014 23:39:51 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf3712027pdj.11 for ; Wed, 26 Feb 2014 15:39:50 -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:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=qSHObqO+MSe62DKlczmX55b7rR2wMQqnuw7iuQITs88=; b=CEBISFxwS3sF52qgCgRJTrtLBZur86QTTE8mTgQDtVlU3hhVxTTIErOmpNxuOQK+U3 i1wblOdONpi4svAY2DtmX5uCJYdZR+He9Bppoeu0yaLOXBwXbwlRwXod5XG0lzxwk28S tNK18rH6XpI8fFxPRgwH9BTMRZL0BRyKxs1JTgZ9LdeDCH6v3mOXtQgJmYGpkfh9EgL0 ngzao9Gyo3JB+38JoI8iHvpvFxCYU7iuxHYy4OBtH2aClZMH7T+6c2cexXQl2aZRGdu9 ECxsdOc4awHAmwIAyE8/A7LI+gxkrVLulj+DHl8JJFXwe4dfPnUbesiVWRpSNITmAa59 O7dg== X-Gm-Message-State: ALoCoQloiKpDcKe9hwDKUnP9AajqGc6HUZ4aW2aqg3a0MGLjplsjv8fiAoQUPPirtwrEy2ZhxeyW X-Received: by 10.66.252.198 with SMTP id zu6mr4452302pac.25.1393457990683; Wed, 26 Feb 2014 15:39:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.201 with SMTP id d67ls505701qgd.62.gmail; Wed, 26 Feb 2014 15:39:50 -0800 (PST) X-Received: by 10.220.99.7 with SMTP id s7mr7929813vcn.19.1393457990525; Wed, 26 Feb 2014 15:39:50 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id cz20si662681veb.15.2014.02.26.15.39.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 15:39:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so2914272veb.25 for ; Wed, 26 Feb 2014 15:39:50 -0800 (PST) X-Received: by 10.58.200.229 with SMTP id jv5mr7838191vec.15.1393457990424; Wed, 26 Feb 2014 15:39:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp62634vcz; Wed, 26 Feb 2014 15:39:50 -0800 (PST) X-Received: by 10.180.91.164 with SMTP id cf4mr6976041wib.37.1393457989661; Wed, 26 Feb 2014 15:39:49 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id 10si1876299wjp.35.2014.02.26.15.39.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 15:39:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WIo4p-0006SK-0x; Wed, 26 Feb 2014 23:39:47 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [PATCH] tests/test-int128: Don't use __noclone__ attribute on clang Date: Wed, 26 Feb 2014 23:39:46 +0000 Message-Id: <1393457987-24791-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- __has_attribute and friends are a clang feature it would be nice if the GCC devs stole :-) If they'd had it from the start it would have obviated all the horrible specific-version-of-gcc checks that compiler.h has to do... This is the only file in the tree using __noclone__ so it seems simplest to fix this here rather than putting it in compiler.h. 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);