From f081acbfba84ffdf1e479f932906bf10f88cd1c2 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 6 Oct 2016 04:05:30 +0200 Subject: 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. --- tests/tcctest.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/tcctest.c') 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; -- cgit v1.3.1