public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4186] testsuite: Add test for already-fixed issue with _Pragma expansion [PR90400]
@ 2023-09-20 20:46 Lewis Hyatt
  0 siblings, 0 replies; only message in thread
From: Lewis Hyatt @ 2023-09-20 20:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d8e08ba9396b1f7da50011468f260250b7afaab7

commit r14-4186-gd8e08ba9396b1f7da50011468f260250b7afaab7
Author: Lewis Hyatt <lhyatt@gmail.com>
Date:   Fri Aug 25 15:57:19 2023 -0400

    testsuite: Add test for already-fixed issue with _Pragma expansion [PR90400]
    
    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.

Diff:
---
 gcc/testsuite/c-c++-common/cpp/pr90400.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

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} } */
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-20 20:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-20 20:46 [gcc r14-4186] testsuite: Add test for already-fixed issue with _Pragma expansion [PR90400] Lewis Hyatt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).