[cfe-commits] r62049 - in /cfe/trunk: lib/CodeGen/CGStmt.cpp test/CodeGen/asm.c
Anders Carlsson
andersca at mac.com
Sun Jan 11 13:23:27 PST 2009
Author: andersca
Date: Sun Jan 11 15:23:27 2009
New Revision: 62049
URL: http://llvm.org/viewvc/llvm-project?rev=62049&view=rev
Log:
More inline asm fixes
Modified:
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/test/CodeGen/asm.c
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=62049&r1=62048&r2=62049&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Sun Jan 11 15:23:27 2009
@@ -944,7 +944,10 @@
const Expr *InputExpr = S.getOutputExpr(i);
llvm::Value *Arg = EmitAsmInput(S, Info, InputExpr, InOutConstraints);
- InOutConstraints += llvm::utostr(Args.size());
+ if (Info & TargetInfo::CI_AllowsRegister)
+ InOutConstraints += llvm::utostr(i);
+ else
+ InOutConstraints += OutputConstraint;
InOutArgTypes.push_back(Arg->getType());
InOutArgs.push_back(Arg);
Modified: cfe/trunk/test/CodeGen/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm.c?rev=62049&r1=62048&r2=62049&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/asm.c (original)
+++ cfe/trunk/test/CodeGen/asm.c Sun Jan 11 15:23:27 2009
@@ -1,5 +1,21 @@
-// RUN: clang %s -arch=i386 -verify -fsyntax-only
-void f(int len)
+// RUN: clang -emit-llvm %s -o %t -arch=i386
+void t1(int len)
{
- __asm__ volatile("" :"=&r"(len), "+&r"(len));
+ __asm__ volatile("" : "=&r"(len), "+&r"(len));
}
+
+void t2(unsigned long long t)
+{
+ __asm__ volatile("" : "+m"(t));
+}
+
+void t3(unsigned char *src, unsigned long long temp)
+{
+ __asm__ volatile("" : "+m"(temp), "+r"(src));
+}
+
+
+
+
+
+
More information about the cfe-commits
mailing list