diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2014-08-22 06:05:21 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2014-08-22 06:05:21 +0000 |
commit | 987f1864caeb3b685e03d78c7316b97c506b649f (patch) | |
tree | 296cf883168550c66c87af1a4588cd53dd262dc6 /clang/test/Sema/inline-asm-validate.c | |
parent | 118da50a2aa6eb6464cf39e81b165f171fa13802 (diff) | |
download | bcm5719-llvm-987f1864caeb3b685e03d78c7316b97c506b649f.tar.gz bcm5719-llvm-987f1864caeb3b685e03d78c7316b97c506b649f.zip |
[AArch64, inline-asm] Improve diagnostic that is printed when the size of a
variable that has regiser constraint "r" is not 64-bit.
General register operands are output using 64-bit "x" register names, regardless
of the size of the variable, unless the asm operand is prefixed with the "%w"
modifier. This surprises and confuses many users who aren't familiar with
aarch64 inline assembly rules.
With this commit, a note and fixit hint are printed which tell the users that
they need modifier "%w" in order to output a "w" register instead of an "x"
register.
<rdar://problem/12764785>
llvm-svn: 216260
Diffstat (limited to 'clang/test/Sema/inline-asm-validate.c')
-rw-r--r-- | clang/test/Sema/inline-asm-validate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/inline-asm-validate.c b/clang/test/Sema/inline-asm-validate.c index 6fa760c8092..73335e76cd8 100644 --- a/clang/test/Sema/inline-asm-validate.c +++ b/clang/test/Sema/inline-asm-validate.c @@ -3,6 +3,6 @@ unsigned t, r, *p; int foo (void) { - __asm__ __volatile__( "stxr %w[_t], %[_r], [%[_p]]" : [_t] "=&r" (t) : [_p] "p" (p), [_r] "r" (r) : "memory"); // expected-warning{{value size does not match register size specified by the constraint and modifier}} + __asm__ __volatile__( "stxr %w[_t], %[_r], [%[_p]]" : [_t] "=&r" (t) : [_p] "p" (p), [_r] "r" (r) : "memory"); // expected-warning{{value size does not match register size specified by the constraint and modifier}} expected-note {{use constraint modifier "w"}} return 1; } |