From 987f1864caeb3b685e03d78c7316b97c506b649f Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Fri, 22 Aug 2014 06:05:21 +0000 Subject: [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. llvm-svn: 216260 --- clang/test/Sema/inline-asm-validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test/Sema/inline-asm-validate.c') 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; } -- cgit v1.2.3