diff options
author | Lewis Hyatt <lhyatt@gmail.com> | 2023-08-25 15:57:19 -0400 |
---|---|---|
committer | Lewis Hyatt <lhyatt@gmail.com> | 2023-09-20 16:44:25 -0400 |
commit | d8e08ba9396b1f7da50011468f260250b7afaab7 (patch) | |
tree | 962599785c1a2f20623e65fe81b2fe85bed5f0f9 | |
parent | 601dbf2a799f691688dfe78250b5bea2717b5b5e (diff) | |
download | gcc-d8e08ba9396b1f7da50011468f260250b7afaab7.zip gcc-d8e08ba9396b1f7da50011468f260250b7afaab7.tar.gz gcc-d8e08ba9396b1f7da50011468f260250b7afaab7.tar.bz2 |
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.
-rw-r--r-- | gcc/testsuite/c-c++-common/cpp/pr90400.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 0000000..4f2cab8 --- /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} } */ +} |