
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
10 lines
393 B
C
10 lines
393 B
C
// RUN: %clang_cc1 -triple arm64-apple-ios7.1 -fsyntax-only -verify %s
|
|
|
|
void foo() {
|
|
asm volatile("USE(%0)" :: "z"(0LL));
|
|
asm volatile("USE(%x0)" :: "z"(0LL));
|
|
asm volatile("USE(%w0)" :: "z"(0));
|
|
|
|
asm volatile("USE(%0)" :: "z"(0)); // expected-warning {{value size does not match register size specified by the constraint and modifier}} expected-note {{use constraint modifier "w"}}
|
|
}
|