forked from OSchip/llvm-project
parent
d959d753bc
commit
8c920c9220
|
@ -1654,10 +1654,10 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
|
|||
FuncAttrs |= llvm::Attribute::NoUnwind;
|
||||
if (TargetDecl->getAttr<NoReturnAttr>())
|
||||
FuncAttrs |= llvm::Attribute::NoReturn;
|
||||
if (TargetDecl->getAttr<PureAttr>())
|
||||
FuncAttrs |= llvm::Attribute::ReadOnly;
|
||||
if (TargetDecl->getAttr<ConstAttr>())
|
||||
FuncAttrs |= llvm::Attribute::ReadNone;
|
||||
else if (TargetDecl->getAttr<PureAttr>())
|
||||
FuncAttrs |= llvm::Attribute::ReadOnly;
|
||||
}
|
||||
|
||||
QualType RetTy = FI.getReturnType();
|
||||
|
|
|
@ -43,4 +43,8 @@ int f12(int arg) {
|
|||
return arg ? 0 : f10_t();
|
||||
}
|
||||
|
||||
// RUN: grep 'define void @f13() nounwind readnone' %t &&
|
||||
void f13(void) __attribute__((pure)) __attribute__((const));
|
||||
void f13(void){}
|
||||
|
||||
// RUN: true
|
||||
|
|
Loading…
Reference in New Issue