diff options
author | Andreas Krebbel <krebbel@linux.ibm.com> | 2021-05-18 08:51:08 +0200 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.ibm.com> | 2021-05-18 08:51:50 +0200 |
commit | 7e75d62442fc3707c96c53d22f6c185fdf893c72 (patch) | |
tree | d7fc14869e3198702ed171c78e051f0c91d7d354 | |
parent | 720dff974ea0487c35c0a4bfa527f30df5066ce1 (diff) | |
download | gcc-7e75d62442fc3707c96c53d22f6c185fdf893c72.zip gcc-7e75d62442fc3707c96c53d22f6c185fdf893c72.tar.gz gcc-7e75d62442fc3707c96c53d22f6c185fdf893c72.tar.bz2 |
IBM Z: Support vector _Bool language extension
_Bool needs to be defined as macro in order to trigger the
context-sensitive macro expansion mechanism.
gcc/ChangeLog:
* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Define
_Bool as macro expanding to _Bool.
gcc/testsuite/ChangeLog:
* gcc.target/s390/zvector/vec-_Bool.c: New test.
-rw-r--r-- | gcc/config/s390/s390-c.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/config/s390/s390-c.c b/gcc/config/s390/s390-c.c index 7dbd8bf..4cce261 100644 --- a/gcc/config/s390/s390-c.c +++ b/gcc/config/s390/s390-c.c @@ -367,6 +367,8 @@ s390_cpu_cpp_builtins_internal (cpp_reader *pfile, old_opts, opts, "vector=vector", "vector"); s390_def_or_undef_macro (pfile, target_flag_set_p (MASK_ZVECTOR), old_opts, opts, "bool=bool", "bool"); + s390_def_or_undef_macro (pfile, target_flag_set_p (MASK_ZVECTOR), + old_opts, opts, "_Bool=_Bool", "_Bool"); if (TARGET_ZVECTOR_P (opts->x_target_flags) && __vector_keyword == NULL) { __vector_keyword = get_identifier ("__vector"); diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c b/gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c new file mode 100644 index 0000000..525b950 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-march=z13 -mzvector" } */ + +vector _Bool char bc; +vector _Bool short int bs; +vector _Bool int bi; +vector _Bool long long bll; |