Skip to content

Commit

Permalink
s390: avoid peeking eof after __vector
Browse files Browse the repository at this point in the history
Same like PR101168, it is need for s390 to
avoid peeking eof after vector keyword.
And similar test case is also ok for s390.

	PR target/95782

gcc/ChangeLog:

	* config/s390/s390-c.cc (s390_macro_to_expand): Avoid empty identifier.

gcc/testsuite/ChangeLog:

	* g++.target/s390/pr95782.C: New test.
  • Loading branch information
Jiufu Guo committed Apr 28, 2024
1 parent 16da75c commit 83bc41e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gcc/config/s390/s390-c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ s390_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
/* __vector long __bool a; */
if (ident == C_CPP_HASHNODE (__bool_keyword))
expand_bool_p = true;
else

/* If there are more tokens to check. */
else if (ident)
{
/* Triggered with: __vector long long __bool a; */
do
Expand Down
5 changes: 5 additions & 0 deletions gcc/testsuite/g++.target/s390/pr95782.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// { dg-do compile }
// { dg-options "-march=z14 -mzvector" }

using vdbl = __vector double;
#define BREAK 1

0 comments on commit 83bc41e

Please sign in to comment.