]> granicus.if.org Git - clang/commitdiff
Add a missing 'break' to ensure that we reject inline assembly
authorEric Christopher <echristo@apple.com>
Thu, 16 Aug 2012 23:50:41 +0000 (23:50 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 16 Aug 2012 23:50:41 +0000 (23:50 +0000)
constraints we don't recognize.

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

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

index 883864fd9a189403965583e0fd6dc49991fe67a5..769f777dc8f6f2b413f4533e0403e425a65aaa77 100644 (file)
@@ -3085,7 +3085,7 @@ public:
                                      TargetInfo::ConstraintInfo &Info) const {
     // FIXME: Check if this is complete
     switch (*Name) {
-    default:
+    default: break;
     case 'l': // r0-r7
     case 'h': // r8-r15
     case 'w': // VFP Floating point register single precision
diff --git a/test/Sema/arm-asm.c b/test/Sema/arm-asm.c
new file mode 100644 (file)
index 0000000..3fc0eeb
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -triple armv7-apple-darwin -verify -fsyntax-only
+
+void f (void) {
+  int Val;
+  asm volatile ("lw (r1), %0[val]": "=&b"(Val)); // expected-error {{invalid output constraint '=&b' in asm}}
+  return;
+}