Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C20A2C54E4B for ; Mon, 11 May 2020 10:14:43 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 946D62075E for ; Mon, 11 May 2020 10:14:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Gf+atby7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 946D62075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 870E686250; Mon, 11 May 2020 10:14:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id awzl_jHts1-t; Mon, 11 May 2020 10:14:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2F26D85D40; Mon, 11 May 2020 10:14:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1D3B0C0176; Mon, 11 May 2020 10:14:43 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 96D5BC016F for ; Mon, 11 May 2020 10:14:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 86B4386169 for ; Mon, 11 May 2020 10:14:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zpKOu9YQgG5T for ; Mon, 11 May 2020 10:14:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 3309785D40 for ; Mon, 11 May 2020 10:14:42 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id fu13so7552279pjb.5 for ; Mon, 11 May 2020 03:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oiiyaaxVdFQ8E5eoYpxjpSkj51vxoyU7jiIbcmsszCg=; b=Gf+atby7kK3HnKx5+z65F5uyILaVJg7DhmduYBGEwx1U9RfKgZ0SwLCqv5ggykmIwc llWwL/KVZcCwyu7qHw1snXCscnp1WafN+ts1rl6cLliptorGJK++6YEpShUPoao06P7u M3LkvWjYadCgt4MjmX7gyaT0txPkLAhf39dCfXDV5YAHjmlCBABMlZRIxK+vr65eHR0q shYaSSgXppN+cz32NtmHxps42ld35Z4BOnN4EAAjBTvIcnK8vU1Fnjk+lcM74I7CKyk+ VDDgalM17phC0AmWqH3N4q4ZACqsC63WteCSIUMvbLc00xbpGhRQSCkEJwJrH35aAd93 WgjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oiiyaaxVdFQ8E5eoYpxjpSkj51vxoyU7jiIbcmsszCg=; b=is1p25Ox4SHbveS/0fRLTCoOxOSbvR9FWY3uquNWumdhjvdkwX7V3YRfdAx8hUODIH xX67QVIasTT/G620F6oRcQ03ij2Zvpqt2GR9/RP9RD1GEywGW3FqJEOBNerCKtTb0qi7 bqGB8BOkAEsNXbgt+7lYDdQ25zdVqlmCJr0Jt1kzaNZDdHKOKVpL7M/TSFD0GX3jf6dY WUqxtOOR7xOFb92f/wKD/u90q7KPMbl114qKhq8jhOnbQIS2wfPnNmU+7v59o1z1ZSsG C3rUMpzD1HC/ZFi44SxYQJawkHoFX+875QoCiY8AHeAYaWyzuMqJt7RFQacTWUN0ObYJ A2Xg== X-Gm-Message-State: AGi0PubUDoyqHtVx8oUQ4QGYDI/zmgLJPc7Jds1h7bXz7BXVq6LU9jmq 0/2yRqFLn7l8WHHjhlZXYcU= X-Google-Smtp-Source: APiQypJcul5aGu4ZUBIMjkLKpKd+vMpdGKNVuu624rYIRqdOPFoTqAZPFAqwdNq2eh5VNgsfK4wHHw== X-Received: by 2002:a17:90a:718c:: with SMTP id i12mr21796289pjk.58.1589192081735; Mon, 11 May 2020 03:14:41 -0700 (PDT) Received: from localhost.localdomain ([2405:204:382:66db:4729:1ab8:2139:8945]) by smtp.gmail.com with ESMTPSA id j14sm10021121pjm.27.2020.05.11.03.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 03:14:41 -0700 (PDT) From: Jaskaran Singh To: cocci@systeme.lip6.fr Date: Mon, 11 May 2020 15:42:59 +0530 Message-Id: <20200511101300.11101-23-jaskaransingh7654321@gmail.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200511101300.11101-1-jaskaransingh7654321@gmail.com> References: <20200511101300.11101-1-jaskaransingh7654321@gmail.com> MIME-Version: 1.0 Cc: julia.lawall@inria.fr, jaskaransingh7654321@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org Subject: [Linux-kernel-mentees] [PATCH v3 22/23] tests: Add test case for removing parameter attributes X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" Add a test case for removing Parameter attributes. The test case checks correct removal of the attribute when it is: - before the parameter type. - after the parameter type and before the parameter identifier. - after the parameter identifier. Signed-off-by: Jaskaran Singh --- tests/remove_param_attrs.c | 11 +++++++++++ tests/remove_param_attrs.cocci | 13 +++++++++++++ tests/remove_param_attrs.res | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100644 tests/remove_param_attrs.c create mode 100644 tests/remove_param_attrs.cocci create mode 100644 tests/remove_param_attrs.res diff --git a/tests/remove_param_attrs.c b/tests/remove_param_attrs.c new file mode 100644 index 00000000..8ec1ffde --- /dev/null +++ b/tests/remove_param_attrs.c @@ -0,0 +1,11 @@ +int func1(int x, __nocast int y) { + return 0; +} + +int func2(int x, int __nocast y) { + return 0; +} + +int func3(int x, int y __nocast) { + return 0; +} diff --git a/tests/remove_param_attrs.cocci b/tests/remove_param_attrs.cocci new file mode 100644 index 00000000..43f5a204 --- /dev/null +++ b/tests/remove_param_attrs.cocci @@ -0,0 +1,13 @@ +@@ +type T,U; +attribute name __nocast; +identifier x,y; +@@ + +T x( + ..., + U y +- __nocast + , + ... + ) {...} diff --git a/tests/remove_param_attrs.res b/tests/remove_param_attrs.res new file mode 100644 index 00000000..3705e814 --- /dev/null +++ b/tests/remove_param_attrs.res @@ -0,0 +1,11 @@ +int func1(int x, int y) { + return 0; +} + +int func2(int x, int y) { + return 0; +} + +int func3(int x, int y) { + return 0; +} -- 2.21.1 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees