]> granicus.if.org Git - clang/commitdiff
fix PR4938 by recognizing % as a modifier on outputs,
authorChris Lattner <sabre@nondot.org>
Tue, 13 Oct 2009 04:32:07 +0000 (04:32 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 13 Oct 2009 04:32:07 +0000 (04:32 +0000)
previously we only recognized it on inputs.

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

lib/Basic/TargetInfo.cpp
test/CodeGen/asm.c

index 35d9ccd401da3fa087ebcdf032873e9edc3e52ca..9cd12493e7a494b19b7d8c3220006cfaeba0e198 100644 (file)
@@ -188,6 +188,9 @@ bool TargetInfo::validateOutputConstraint(ConstraintInfo &Info) const {
       }
     case '&': // early clobber.
       break;
+    case '%': // commutative.
+      // FIXME: Check that there is a another register after this one.
+      break;
     case 'r': // general register.
       Info.setAllowsRegister();
       break;
index 46563213b1e84efa6527fc641c998993aa359efb..52afc9152748d72189841bb58f2995e1ee0df6f8 100644 (file)
@@ -101,3 +101,12 @@ void t14(struct S *P) {
 }
 
 
+// PR4938
+int t16() {
+  int a,b;
+  asm ( "nop;"
+       :"=%c" (a)
+       : "r" (b)
+       );
+  return 0;
+}