File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -2065,7 +2065,9 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
2065
2065
Align = Target->getDoubleAlign();
2066
2066
break;
2067
2067
case BuiltinType::LongDouble:
2068
- if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice &&
2068
+ if (((getLangOpts().SYCL && getLangOpts().SYCLIsDevice) ||
2069
+ (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice)) &&
2070
+ AuxTarget != nullptr &&
2069
2071
(Target->getLongDoubleWidth() != AuxTarget->getLongDoubleWidth() ||
2070
2072
Target->getLongDoubleAlign() != AuxTarget->getLongDoubleAlign())) {
2071
2073
Width = AuxTarget->getLongDoubleWidth();
Original file line number Diff line number Diff line change @@ -209,8 +209,6 @@ class LLVM_LIBRARY_VISIBILITY MicrosoftX86_32SPIRTargetInfo
209
209
MicrosoftX86_32SPIRTargetInfo (const llvm::Triple &Triple,
210
210
const TargetOptions &Opts)
211
211
: WindowsX86_32SPIRTargetInfo(Triple, Opts) {
212
- LongDoubleWidth = LongDoubleAlign = 64 ;
213
- LongDoubleFormat = &llvm::APFloat::IEEEdouble ();
214
212
assert (DataLayout->getPointerSizeInBits () == 32 );
215
213
}
216
214
@@ -261,8 +259,6 @@ class LLVM_LIBRARY_VISIBILITY MicrosoftX86_64_SPIR64TargetInfo
261
259
MicrosoftX86_64_SPIR64TargetInfo (const llvm::Triple &Triple,
262
260
const TargetOptions &Opts)
263
261
: WindowsX86_64_SPIR64TargetInfo(Triple, Opts) {
264
- LongDoubleWidth = LongDoubleAlign = 64 ;
265
- LongDoubleFormat = &llvm::APFloat::IEEEdouble ();
266
262
assert (DataLayout->getPointerSizeInBits () == 64 );
267
263
}
268
264
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-unknown-linux-gnu -fsyntax-only -DLONG_DOUBLE_SIZE=16 -verify %s
2
+ // RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir-unknown-unknown-sycldevice -aux-triple i386-pc-linux-gnu -fsyntax-only -DLONG_DOUBLE_SIZE=12 -verify %s
3
+ // RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-windows-sycldevice -aux-triple x86_64-pc-windows-msvc -fsyntax-only -DLONG_DOUBLE_SIZE=8 -verify %s
4
+ // RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir-unknown-windows-sycldevice -aux-triple i686-pc-windows-msvc -fsyntax-only -DLONG_DOUBLE_SIZE=8 -verify %s
5
+ // expected-no-diagnostics
6
+
7
+ static_assert (sizeof (long double ) == LONG_DOUBLE_SIZE, "wrong sizeof long double");
You can’t perform that action at this time.
0 commit comments