'c' and 'v' do not work as asm clobber or output registers #329
Closed
Description
Specifying "c" or "v" as clobber registers give an error, rather than being supported as described here.
int main(void)
{
unsigned char a = 0x86;
asm (
"rol"
: "+a"(a)
:: "c"
);
asm (
"bit llvm-mos/llvm-mos-sdk#27"
: "+a"(a)
:: "v"
);
return 0;
}
Result:
$ mos-common-clang asm-flags.c
asm-flags.c:7:12: error: unknown register name 'c' in asm
:: "c"
^
asm-flags.c:12:12: error: unknown register name 'v' in asm
:: "v"
^
2 errors generated.
Attempting to use "c" (or "v") as an output register compiles OK, but causes a link-time crash and stack trace.
int main(void)
{
unsigned char a = 0x86;
unsigned char c;
asm (
"rol"
: "+a"(a), "=c"(c)
::
);
return 0;
}
Result:
LLVM ERROR: unable to translate instruction: call (in function: main)
Metadata
Assignees
Labels
No labels