diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 620290af9509f..a13c04d69c4ba 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -4700,7 +4700,8 @@ void Sema::AddModeAttr(Decl *D, const AttributeCommonInfo &CI, if (NewElemTy.isNull()) { // Only emit diagnostic on host for 128-bit mode attribute - if (!(DestWidth == 128 && getLangOpts().CUDAIsDevice)) + if (!(DestWidth == 128 && + (getLangOpts().CUDAIsDevice || getLangOpts().SYCLIsDevice))) Diag(AttrLoc, diag::err_machine_mode) << 1 /*Unsupported*/ << Name; return; } diff --git a/clang/test/SemaSYCL/float128.cpp b/clang/test/SemaSYCL/float128.cpp index b1a022216aaff..e41dea38dbe75 100644 --- a/clang/test/SemaSYCL/float128.cpp +++ b/clang/test/SemaSYCL/float128.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -triple spir64 -fsycl-is-device -verify -fsyntax-only %s // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsycl-is-device -fsyntax-only %s +typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); typedef __float128 BIGTY; template