look at the right operand when increasing the size of an asm output,

this fixes http://llvm.org/bugs/show_bug.cgi?id=3373#c20

llvm-svn: 70685
This commit is contained in:
Chris Lattner 2009-05-03 09:05:53 +00:00
parent ccf6183687
commit 61af27860d
2 changed files with 14 additions and 3 deletions

View File

@ -848,11 +848,9 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
for (InputNo = 0; InputNo != S.getNumInputs(); ++InputNo) { for (InputNo = 0; InputNo != S.getNumInputs(); ++InputNo) {
TargetInfo::ConstraintInfo &Input = InputConstraintInfos[InputNo]; TargetInfo::ConstraintInfo &Input = InputConstraintInfos[InputNo];
if (Input.hasTiedOperand() && if (Input.hasTiedOperand() &&
Input.getTiedOperand() == i) { Input.getTiedOperand() == i)
InputNo = i;
break; break;
} }
}
assert(InputNo != S.getNumInputs() && "Didn't find matching input!"); assert(InputNo != S.getNumInputs() && "Didn't find matching input!");
QualType InputTy = S.getInputExpr(InputNo)->getType(); QualType InputTy = S.getInputExpr(InputNo)->getType();

View File

@ -77,6 +77,19 @@ unsigned char t13(unsigned input) {
return output; return output;
} }
struct large {
int x[1000];
};
unsigned long t15(int x, struct large *P) {
__asm__("xyz "
: "=r" (x)
: "m" (*P), "0" (x));
return x;
}
// bitfield destination of an asm. // bitfield destination of an asm.
struct S { struct S {