forked from OSchip/llvm-project
Basic: [asmSymbolicName] follows the same rule as numbers in asm inputs
Input constraints like "0" and "[foo]" should be treated the same when it comes to their corresponding output constraint. This fixes PR21850. llvm-svn: 225605
This commit is contained in:
parent
e38b24a72b
commit
55164f901b
|
@ -583,6 +583,10 @@ bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints,
|
||||||
if (Info.hasTiedOperand() && Info.getTiedOperand() != Index)
|
if (Info.hasTiedOperand() && Info.getTiedOperand() != Index)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// A number must refer to an output only operand.
|
||||||
|
if (OutputConstraints[Index].isReadWrite())
|
||||||
|
return false;
|
||||||
|
|
||||||
Info.setTiedOperand(Index, OutputConstraints[Index]);
|
Info.setTiedOperand(Index, OutputConstraints[Index]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,3 +190,10 @@ void fn4() {
|
||||||
: "=r"(l)
|
: "=r"(l)
|
||||||
: "#m"(l)); // expected-error {{invalid input constraint '#m' in asm}}
|
: "#m"(l)); // expected-error {{invalid input constraint '#m' in asm}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fn5() {
|
||||||
|
int l;
|
||||||
|
__asm__(""
|
||||||
|
: [g] "+r"(l)
|
||||||
|
: "[g]"(l)); // expected-error {{invalid input constraint '[g]' in asm}}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue