aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-08-08 20:46:16 +0200
committerMichael Matz <matz@suse.de>2016-12-15 17:47:10 +0100
commit0381387640fecfc1d8bd9e79d972a2b58c508069 (patch)
tree39e348e4ecc5537f9b57dae4deaf03da51d26351 /tests
parent9e0af6d2b513ed7ee2f6221bbdf85a8e54e00fc1 (diff)
downloadtinycc-0381387640fecfc1d8bd9e79d972a2b58c508069.tar.gz
tinycc-0381387640fecfc1d8bd9e79d972a2b58c508069.tar.bz2
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).
Diffstat (limited to 'tests')
-rw-r--r--tests/tcctest.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index f8a9ca6..52dbfaf 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -2678,6 +2678,9 @@ void asm_test(void)
int base_func = 42;
void override_func3 (void);
unsigned long asmret;
+#ifdef BOOL_ISOC99
+ _Bool somebool;
+#endif
printf("inline asm:\n");
@@ -2726,6 +2729,13 @@ void asm_test(void)
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;
label1:
goto label2;