aboutsummaryrefslogtreecommitdiff
path: root/tests/tcctest.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-10-06 04:05:30 +0200
committerMichael Matz <matz@suse.de>2016-12-15 17:47:13 +0100
commitf081acbfba84ffdf1e479f932906bf10f88cd1c2 (patch)
tree16f39dd9b65312bc83bb5b3d3e462b6242630b9a /tests/tcctest.c
parent3bc9c325c5fa754043986cc70ff2af45c2196c38 (diff)
downloadtinycc-f081acbfba84ffdf1e479f932906bf10f88cd1c2.tar.gz
tinycc-f081acbfba84ffdf1e479f932906bf10f88cd1c2.tar.bz2
Support local register variables
Similar to GCC a local asm register variable enforces the use of a specified register in asm operands (and doesn't otherwise matter). Works only if the variable is directly mentioned as operand. For that we now generally store a backpointer from an SValue to a Sym when the SValue was the result of unary() parsing a symbol identifier.
Diffstat (limited to 'tests/tcctest.c')
-rw-r--r--tests/tcctest.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 5190523..d4a6a5a 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -2939,6 +2939,7 @@ void asm_test(void)
#ifdef BOOL_ISOC99
_Bool somebool;
#endif
+ register int regvar asm("%esi");
printf("inline asm:\n");
@@ -3001,6 +3002,8 @@ void asm_test(void)
val = 44;
fancy_copy2 (&val, &val2);
printf ("fancycpy2(%d)=%d\n", val, val2);
+ asm volatile ("mov $0x4243, %%esi" : "=r" (regvar));
+ printf ("regvar=%x\n", regvar);
return;
label1:
goto label2;