If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63127 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp
index 3ec3551..2b73582 100644
--- a/lib/Basic/TargetInfo.cpp
+++ b/lib/Basic/TargetInfo.cpp
@@ -222,6 +222,7 @@
 bool TargetInfo::validateInputConstraint(const char *Name,
                                          const std::string *OutputNamesBegin,
                                          const std::string *OutputNamesEnd,
+                                         ConstraintInfo* OutputConstraints,
                                          ConstraintInfo &info) const {
   info = CI_None;
 
@@ -236,6 +237,10 @@
         // Check if matching constraint is out of bounds.
         if (i >= NumOutputs)
           return false;
+        
+        // The constraint should have the same info as the respective 
+        // output constraint.
+        info = (ConstraintInfo)(info|OutputConstraints[i]);
       } else if (!validateAsmConstraint(*Name, info)) {
         // FIXME: This error return is in place temporarily so we can
         // add more constraints as we hit it.  Eventually, an unknown