diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/lib/Basic/TargetInfo.cpp @@ -745,6 +745,7 @@ Info.setAllowsMemory(); break; case 'g': // general register, memory operand or immediate integer. + case 'p': // address operand. case 'X': // any operand. Info.setAllowsRegister(); Info.setAllowsMemory(); diff --git a/clang/test/Sema/inline-asm-validate.c b/clang/test/Sema/inline-asm-validate.c --- a/clang/test/Sema/inline-asm-validate.c +++ b/clang/test/Sema/inline-asm-validate.c @@ -7,8 +7,6 @@ // Ensure we accept pointer and non-pointer arguments to "p" constrained // inputs. asm (""::"p"(t), "p"(p), "p"(&t)); - // TODO: Ensure we accept p output constraints. - asm ("":"=p"(t)); // expected-error{{invalid output constraint '=p' in asm}} - asm ("":"=p"(p)); // expected-error{{invalid output constraint '=p' in asm}} - asm ("":"=p"(&t)); // expected-error{{invalid output constraint '=p' in asm}} + asm ("":"=p"(t), "=p"(p)); + asm ("":"=p"(&t)); // expected-error{{invalid lvalue in asm output}} }