[cfe-commits] r47618 - in /cfe/trunk: CodeGen/CGStmt.cpp test/CodeGen/2008-02-26-inline-asm-bug.c
Lauro Ramos Venancio
lauro.venancio at gmail.com
Tue Feb 26 11:19:58 PST 2008
Author: laurov
Date: Tue Feb 26 13:19:58 2008
New Revision: 47618
URL: http://llvm.org/viewvc/llvm-project?rev=47618&view=rev
Log:
Fix a bug in ConvertAsmString function.
Added:
cfe/trunk/test/CodeGen/2008-02-26-inline-asm-bug.c
Modified:
cfe/trunk/CodeGen/CGStmt.cpp
Modified: cfe/trunk/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGStmt.cpp?rev=47618&r1=47617&r2=47618&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/CodeGen/CGStmt.cpp Tue Feb 26 13:19:58 2008
@@ -569,7 +569,7 @@
}
Result += '$' + llvm::utostr(n);
- Start = End;
+ Start = End - 1;
} else if (isalpha(EscapedChar)) {
char *End;
@@ -583,7 +583,7 @@
}
Result += "${" + llvm::utostr(n) + ':' + EscapedChar + '}';
- Start = End;
+ Start = End - 1;
} else {
assert(0 && "Unhandled asm escaped character!");
}
Added: cfe/trunk/test/CodeGen/2008-02-26-inline-asm-bug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-02-26-inline-asm-bug.c?rev=47618&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-02-26-inline-asm-bug.c (added)
+++ cfe/trunk/test/CodeGen/2008-02-26-inline-asm-bug.c Tue Feb 26 13:19:58 2008
@@ -0,0 +1,6 @@
+// RUN: clang -emit-llvm < %s | grep "\$0,\$1"
+
+void f() {
+ int d1, d2;
+ asm("%0,%1": "=r" (d1) : "r" (d2));
+}
More information about the cfe-commits
mailing list