diff options
author | Chris Lattner <sabre@nondot.org> | 2009-05-03 09:05:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-05-03 09:05:53 +0000 |
commit | 0bdaa5b576237195a260d347f2646cf42ec7d745 (patch) | |
tree | de350b99e734af254547173152e33689afeb32fb | |
parent | 5384b0990ea6995121fd4bad0855e96d41dcad18 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70685 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 4 | ||||
-rw-r--r-- | test/CodeGen/asm.c | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index 0e9cec42c8..6874dc076b 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -848,10 +848,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { for (InputNo = 0; InputNo != S.getNumInputs(); ++InputNo) { TargetInfo::ConstraintInfo &Input = InputConstraintInfos[InputNo]; if (Input.hasTiedOperand() && - Input.getTiedOperand() == i) { - InputNo = i; + Input.getTiedOperand() == i) break; - } } assert(InputNo != S.getNumInputs() && "Didn't find matching input!"); diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c index 8aa392aa80..db6567058d 100644 --- a/test/CodeGen/asm.c +++ b/test/CodeGen/asm.c @@ -77,6 +77,19 @@ unsigned char t13(unsigned input) { 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. struct S { |