x86-asm: Correctly infer register size for bools

Register operands of type _Bool weren't correctly getting
the 8-bit sized registers (but rather used the default 32-bit
ones).
This commit is contained in:
Michael Matz
2016-08-08 20:46:16 +02:00
parent 9e0af6d2b5
commit 0381387640
2 changed files with 12 additions and 1 deletions

View File

@ -2678,6 +2678,9 @@ void asm_test(void)
/* Hide the outer base_func, but check later that the inline
asm block gets the outer one. */
int base_func = 42;
void override_func3 (void);
unsigned long asmret;
#ifdef BOOL_ISOC99
_Bool somebool;
#endif
@ -2726,6 +2729,13 @@ void asm_test(void)
/* Check that we can also load structs of appropriate layout
into registers. */
asm volatile("" : "=r" (asmret) : "0"(s2));
if (asmret != s2.addr)
printf("asmstr: failed\n");
#ifdef BOOL_ISOC99
/* Check that the typesize correctly sets the register size to
8 bit. */
asm volatile("cmp %1,%2; sete %0" : "=a"(somebool) : "r"(1), "r"(2));
if (!somebool)
printf("asmbool: failed\n");
#endif
return;