summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-04-03 05:57:08 +0000
committerAnders Carlsson <andersca@mac.com>2009-04-03 05:57:08 +0000
commit16b1461c2177373cf97df1f9ffc6cdd1eae05f99 (patch)
treee6fb16612401e605e1f5fec3000f57b48eb0f54c /clang
parentb536701bc566131bc79cf4820e872d1f57c03240 (diff)
downloadbcm5719-llvm-16b1461c2177373cf97df1f9ffc6cdd1eae05f99.tar.gz
bcm5719-llvm-16b1461c2177373cf97df1f9ffc6cdd1eae05f99.zip
Ignore plus operands when looking up the operand number from a named operand. This matches llvm-gcc and fixes PR3908.
llvm-svn: 68371
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/Stmt.cpp3
-rw-r--r--clang/test/CodeGen/asm.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 0cf36f98a83..ce55fae87e9 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -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)
diff --git a/clang/test/CodeGen/asm.c b/clang/test/CodeGen/asm.c
index 91d6320ac54..abe91519ed1 100644
--- a/clang/test/CodeGen/asm.c
+++ b/clang/test/CodeGen/asm.c
@@ -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)));
+}
OpenPOWER on IntegriCloud