diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h --- a/clang/lib/Basic/Targets/OSTargets.h +++ b/clang/lib/Basic/Targets/OSTargets.h @@ -535,6 +535,8 @@ DefineStd(Builder, "unix", Opts); Builder.defineMacro("__ELF__"); Builder.defineMacro("__SCE__"); + Builder.defineMacro("__STDC_NO_COMPLEX__"); + Builder.defineMacro("__STDC_NO_THREADS__"); } public: diff --git a/clang/test/C/C11/n1460.c b/clang/test/C/C11/n1460.c --- a/clang/test/C/C11/n1460.c +++ b/clang/test/C/C11/n1460.c @@ -7,9 +7,15 @@ // If we claim to not support the feature then we expect diagnostics when // using that feature. Otherwise, we expect no diagnostics. #ifdef __STDC_NO_COMPLEX__ - // We do not have any targets which do not support complex, so we don't - // expect to get into this block. - #error "it's unexpected that we don't support complex" + // PS4/PS5 set this to indicate no but still support the + // _Complex syntax. + #ifdef __SCE__ + #define HAS_COMPLEX + #else + // We do not have any other targets which do not support complex, so we + // don't expect to get into this block. + #error "it's unexpected that we don't support complex" + #endif float _Complex fc; double _Complex dc; long double _Complex ldc;