]> granicus.if.org Git - clang/commitdiff
Ignore plus operands when looking up the operand number from a named operand. This...
authorAnders Carlsson <andersca@mac.com>
Fri, 3 Apr 2009 05:57:08 +0000 (05:57 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 3 Apr 2009 05:57:08 +0000 (05:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68371 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Stmt.cpp
test/CodeGen/asm.c

index 0cf36f98a83d6d94b5dee0237c55392e2684e7af..ce55fae87e9ab5f77b8a40aeebe134f63194545e 100644 (file)
@@ -177,9 +177,6 @@ int AsmStmt::getNamedOperand(const std::string &SymbolicName) const {
   for (unsigned i = 0, e = getNumOutputs(); i != e; ++i) {
     if (getOutputName(i) == SymbolicName)
       return i;
-    
-    // Keep track of the number of '+' operands.
-    if (isOutputPlusConstraint(i)) ++NumPlusOperands;
   }
   
   for (unsigned i = 0, e = getNumInputs(); i != e; ++i)
index 91d6320ac54bbaff108234faa4160b955c0effab..abe91519ed17d3d5b04555606e1b0b09daaa46dc 100644 (file)
@@ -28,7 +28,7 @@ void t6(void) {
   __asm__ volatile("" : : "i" (t6));
 }
 
-// RUN: grep "T7 NAMED: \$2" %t &&
+// RUN: grep "T7 NAMED: \$1" %t &&
 void t7(int a) {
   __asm__ volatile("T7 NAMED: %[input]" : "+r"(a): [input] "i" (4));
 }
@@ -43,3 +43,9 @@ unsigned t9(unsigned int a) {
   asm("bswap %0 %1" : "+r" (a));
   return a;
 }
+
+// PR3908
+// RUN: grep "PR3908 \$1 \$3 \$2 \$0" %t
+void t10(int r) {
+  __asm__("PR3908 %[lf] %[xx] %[li] %[r]" : [r] "+r" (r) : [lf] "mx" (0), [li] "mr" (0), [xx] "x" ((double)(0)));
+}