Skip to content

Commit 68c943f

Browse files
committed
Add a check against Clang
1 parent 40c166f commit 68c943f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,16 @@ static void checkDataLayoutConsistency(const TargetInfo &Target,
394394
Check("__ibm128", llvm::Type::getPPC_FP128Ty(Context), Target.Ibm128Align);
395395

396396
Check("void*", llvm::PointerType::getUnqual(Context), Target.PointerAlign);
397+
398+
if (Triple.f128LibmShouldUseLongDouble() &&
399+
&Target.getLongDoubleFormat() != &llvm::APFloat::IEEEquad()) {
400+
llvm::errs()
401+
<< "For target " << Triple.str()
402+
<< " LLVM wants to use `long double` symbols for `_Float128` libm call "
403+
"lowering, but clang specifies `long double` as "
404+
<< Target.getLongDoubleFormat() << "\n";
405+
abort();
406+
}
397407
#endif
398408
}
399409

0 commit comments

Comments
 (0)