From patchwork Fri Aug 25 20:45:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lewis Hyatt X-Patchwork-Id: 1826303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=mASQHtSD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RXX6x67bSz1yg9 for ; Sat, 26 Aug 2023 06:46:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7098B385842A for ; Fri, 25 Aug 2023 20:46:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7098B385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692996390; bh=5fHseU5KJ65v9oWzKLBnDS9m2p+fux//JZ+HvAi5oGo=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=mASQHtSDer/0+X102etP02TAIgxyeGdf6zuO/NmkjTZvOqodayImYgRmo2SFXXt7M wm/FkbdI0SWQi3IHO3QrpMpqdBKofwhwWdIVd2fqK1yoMEDoybiuoqXHNRuPghUYXS WowWTSHyeOn3qV5wkb0iDO3tIIY/RLmTXEkeBITY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by sourceware.org (Postfix) with ESMTPS id 57E5A3858D32 for ; Fri, 25 Aug 2023 20:46:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57E5A3858D32 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-76ce59842c1so81109285a.3 for ; Fri, 25 Aug 2023 13:46:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692996363; x=1693601163; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5fHseU5KJ65v9oWzKLBnDS9m2p+fux//JZ+HvAi5oGo=; b=LOre/ZX3BU+sTBnUk28XRjQlHK4kSqAv2abJGjIENqIJT8wHyo4osh/Znbscas9QVc 8EIQOKh/HzAFoAWrnbC+qTp5eROkMTuWVHR5JDsQvigi/bRhrcsuX2080v/sQdhxmQTm 3xqAgp3yqsGvOeVwPqtFeHvfu7PvOIZ3k+mDYuh8sqJC22+1vWlsjYqGITXz2O8/UA5y DCrd6/OhXqB4gyMwmP1MnyzWGTv12xIlnb1R09d7Z06gthKlKUfdcrN0aMj8knfyIcrw 1FbgMe3IPsVSzT160PlSkqp8MzKfn9cxBruRzIuNVO8BPvARko+xZ1PTxWUTX95GnZs4 J+DQ== X-Gm-Message-State: AOJu0Yz7I19TibOcG0UJabbr8S/krDzLY1iwzBD8FT5Ca4zlIxbYJDrP 8mrfUhWl9obnZpuxWyRfsHL4HhPN68Y= X-Google-Smtp-Source: AGHT+IH1Zc/Z4iOd/TlcB7YbubuM0lokbkMkvqpaGgxeR/IwV1KL6COkqCDPNx/tDluhOYfeK1Pm/A== X-Received: by 2002:a05:620a:4309:b0:76c:e9aa:9e09 with SMTP id u9-20020a05620a430900b0076ce9aa9e09mr22097326qko.30.1692996363543; Fri, 25 Aug 2023 13:46:03 -0700 (PDT) Received: from localhost.localdomain (96-67-140-173-static.hfc.comcastbusiness.net. [96.67.140.173]) by smtp.gmail.com with ESMTPSA id h13-20020a37de0d000000b0076ee82f7726sm737971qkj.132.2023.08.25.13.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 13:46:03 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Lewis Hyatt Subject: [PATCH] testsuite: Add test for already-fixed issue with _Pragma expansion [PR90400] Date: Fri, 25 Aug 2023 16:45:54 -0400 Message-Id: <20230825204554.2440771-1-lhyatt@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3038.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lewis Hyatt via Gcc-patches From: Lewis Hyatt Reply-To: Lewis Hyatt Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hello- This is adding a testcase for a PR that was already incidentally fixed. OK to commit please? Thanks... -Lewis -- >8 -- The PR was fixed by r12-5454. Since the fix was somewhat incidental, although related, add a testcase from PR90400 too before closing it out. gcc/testsuite/ChangeLog: PR preprocessor/90400 * c-c++-common/cpp/pr90400.c: New test. --- gcc/testsuite/c-c++-common/cpp/pr90400.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/cpp/pr90400.c diff --git a/gcc/testsuite/c-c++-common/cpp/pr90400.c b/gcc/testsuite/c-c++-common/cpp/pr90400.c new file mode 100644 index 00000000000..4f2cab8d6ab --- /dev/null +++ b/gcc/testsuite/c-c++-common/cpp/pr90400.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-save-temps" } */ +/* PR preprocessor/90400 */ + +#define OUTER(x) x +#define FOR(x) _Pragma ("GCC unroll 0") for (x) +void f () +{ + /* If the pragma were to be seen prior to the expansion of FOR, as was + the case before r12-5454, then the unroll pragma would complain + because the immediately following statement would be ";" rather than + a loop. */ + OUTER (; FOR (int i = 0; i != 1; ++i);) /* { dg-bogus {statement expected before ';' token} } */ +}