Input constraints like "0" and "[foo]" should be treated the same when
it comes to their corresponding output constraint.
This fixes PR21850.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225605
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Info.hasTiedOperand() && Info.getTiedOperand() != Index)
return false;
+ // A number must refer to an output only operand.
+ if (OutputConstraints[Index].isReadWrite())
+ return false;
+
Info.setTiedOperand(Index, OutputConstraints[Index]);
break;
}
: "=r"(l)
: "#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}}
+}