diff options
author | Jiufu Guo <guojiufu@linux.ibm.com> | 2024-03-27 14:15:40 +0800 |
---|---|---|
committer | guojiufu <guojiufu@linux.ibm.com> | 2024-04-28 11:38:47 +0800 |
commit | 83bc41e8364360b63eaa59c88e2fb499a6751233 (patch) | |
tree | 4e0a10dc22ff436ce231fdb7fa4e5ffb3b8cdb8e /gcc | |
parent | 16da75c66631a0ada692ff2af918f7b02173d3cc (diff) | |
download | gcc-83bc41e8364360b63eaa59c88e2fb499a6751233.zip gcc-83bc41e8364360b63eaa59c88e2fb499a6751233.tar.gz gcc-83bc41e8364360b63eaa59c88e2fb499a6751233.tar.bz2 |
s390: avoid peeking eof after __vector
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/s390/s390-c.cc | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.target/s390/pr95782.C | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/config/s390/s390-c.cc b/gcc/config/s390/s390-c.cc index 1bb6e81..4521a86 100644 --- a/gcc/config/s390/s390-c.cc +++ b/gcc/config/s390/s390-c.cc @@ -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 diff --git a/gcc/testsuite/g++.target/s390/pr95782.C b/gcc/testsuite/g++.target/s390/pr95782.C new file mode 100644 index 0000000..daf887f --- /dev/null +++ b/gcc/testsuite/g++.target/s390/pr95782.C @@ -0,0 +1,5 @@ +// { dg-do compile } +// { dg-options "-march=z14 -mzvector" } + +using vdbl = __vector double; +#define BREAK 1 |