]> granicus.if.org Git - clang/commitdiff
Add support for the 'Q' arm memory constraint.
authorEric Christopher <echristo@apple.com>
Fri, 29 Jul 2011 21:20:35 +0000 (21:20 +0000)
committerEric Christopher <echristo@apple.com>
Fri, 29 Jul 2011 21:20:35 +0000 (21:20 +0000)
Fixes rdar://9866494

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136524 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/CodeGen/arm-inline-asm.c [new file with mode: 0644]

index 3aebc41d71318a6eed7ba0f83f20d26c5ab0bf40..48a32caad3ebf3e5cd50a00693f095236f9031c5 100644 (file)
@@ -147,7 +147,7 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
   }
 
   // If -ccc-host-triple arch-pc-win32-macho option specified, we're
-  // generating code for Win32 ABI. No need to emit 
+  // generating code for Win32 ABI. No need to emit
   // __ENVIRONMENT_XX_OS_VERSION_MIN_REQUIRED__.
   if (PlatformName == "win32") {
     PlatformMinVersion = VersionTuple(Maj, Min, Rev);
@@ -2137,6 +2137,9 @@ public:
     case 'P': // VFP Floating point register double precision
       Info.setAllowsRegister();
       return true;
+    case 'Q': // A memory address that is a single base register.
+      Info.setAllowsMemory();
+      return true;
     case 'U': // a memory reference...
       switch (Name[1]) {
       case 'q': // ...ARMV4 ldrsb
diff --git a/test/CodeGen/arm-inline-asm.c b/test/CodeGen/arm-inline-asm.c
new file mode 100644 (file)
index 0000000..0152b05
--- /dev/null
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -w -o - %s | FileCheck %s
+
+void t1 (void *f, int g) {
+  // CHECK: call void asm "str $1, $0", "=*Q,r"
+  asm("str %1, %0" : "=Q"(f) : "r"(g));
+}