diff options
-rw-r--r-- | lib/Basic/TargetInfo.cpp | 3 | ||||
-rw-r--r-- | test/CodeGen/asm.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 35d9ccd401..9cd12493e7 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -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; diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c index 46563213b1..52afc91527 100644 --- a/test/CodeGen/asm.c +++ b/test/CodeGen/asm.c @@ -101,3 +101,12 @@ void t14(struct S *P) { } +// PR4938 +int t16() { + int a,b; + asm ( "nop;" + :"=%c" (a) + : "r" (b) + ); + return 0; +} |