aboutsummaryrefslogtreecommitdiff
path: root/tests/tcctest.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-10-03 20:39:48 +0200
committerMichael Matz <matz@suse.de>2016-12-15 17:47:12 +0100
commit0b0e64c2c95487815a8d252ab833e5eccfb5aeb5 (patch)
tree603b818fdd9b37a0c803bc082beab32e73e24bb1 /tests/tcctest.c
parent7ab35c6265425a81c14bc313eb4c834985a73ddb (diff)
downloadtinycc-0b0e64c2c95487815a8d252ab833e5eccfb5aeb5.tar.gz
tinycc-0b0e64c2c95487815a8d252ab833e5eccfb5aeb5.tar.bz2
x86-asm: Correct register size for pointer ops
A pointer is 64 bit as well, so it needs a full register for register operands.
Diffstat (limited to 'tests/tcctest.c')
-rw-r--r--tests/tcctest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 496de3a..22d9e88 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -2914,6 +2914,11 @@ void fancy_copy (unsigned *in, unsigned *out)
asm volatile ("" : "=r" (*out) : "0" (*in));
}
+void fancy_copy2 (unsigned *in, unsigned *out)
+{
+ asm volatile ("mov %0,(%1)" : : "r" (*in), "r" (out) : "memory");
+}
+
void asm_test(void)
{
char buf[128];
@@ -2987,6 +2992,9 @@ void asm_test(void)
val = 43;
fancy_copy (&val, &val2);
printf ("fancycpy(%d)=%d\n", val, val2);
+ val = 44;
+ fancy_copy2 (&val, &val2);
+ printf ("fancycpy2(%d)=%d\n", val, val2);
return;
label1:
goto label2;