1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

AsmParser: Call instructions can't have an alignment

llvm-svn: 230193
This commit is contained in:
David Majnemer 2015-02-23 00:01:32 +00:00
parent fe7d978682
commit 5ce7bb3582
2 changed files with 19 additions and 2 deletions

View File

@ -4732,10 +4732,14 @@ bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
if (I != E)
return Error(CallLoc, "not enough parameters specified for call");
if (FnAttrs.hasAttributes())
if (FnAttrs.hasAttributes()) {
if (FnAttrs.hasAlignmentAttr())
return Error(CallLoc, "invoke instructions may not have an alignment");
Attrs.push_back(AttributeSet::get(RetType->getContext(),
AttributeSet::FunctionIndex,
FnAttrs));
}
// Finish off the Attribute and check them
AttributeSet PAL = AttributeSet::get(Context, Attrs);
@ -5145,10 +5149,14 @@ bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
if (I != E)
return Error(CallLoc, "not enough parameters specified for call");
if (FnAttrs.hasAttributes())
if (FnAttrs.hasAttributes()) {
if (FnAttrs.hasAlignmentAttr())
return Error(CallLoc, "call instructions may not have an alignment");
Attrs.push_back(AttributeSet::get(RetType->getContext(),
AttributeSet::FunctionIndex,
FnAttrs));
}
// Finish off the Attribute and check them
AttributeSet PAL = AttributeSet::get(Context, Attrs);

View File

@ -0,0 +1,9 @@
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
declare void @f()
define void @g() {
call void @f() align 8
; CHECK: error: call instructions may not have an alignment
ret void
}