mescc: Tinycc support: *global =.
* module/language/c99/compiler.mes (base->ident-address): Support *global = ... * scaffold/tests/74-multi-line-string.c: Test it.
This commit is contained in:
parent
73726b2e27
commit
137547afa7
|
@ -412,7 +412,10 @@
|
||||||
(wrap-as (append (i386:local->accu (local:id local))
|
(wrap-as (append (i386:local->accu (local:id local))
|
||||||
(if (= size 1) (i386:byte-base->accu-address)
|
(if (= size 1) (i386:byte-base->accu-address)
|
||||||
(i386:byte-base->accu-address)))))
|
(i386:byte-base->accu-address)))))
|
||||||
(error "TODO:base->ident-address-global" o)))))
|
(let ((size 4)) ;; FIXME
|
||||||
|
(wrap-as (append (i386:label-mem->accu `(#:address ,o))
|
||||||
|
(if (= size 1) (i386:byte-base->accu-address)
|
||||||
|
(i386:base->accu-address)))))))))
|
||||||
|
|
||||||
(define (value->ident info)
|
(define (value->ident info)
|
||||||
(lambda (o value)
|
(lambda (o value)
|
||||||
|
|
|
@ -28,6 +28,9 @@ char const* help =
|
||||||
" base"
|
" base"
|
||||||
" are";
|
" are";
|
||||||
|
|
||||||
|
int global_i = 1;
|
||||||
|
int *global_p = &global_i;
|
||||||
|
|
||||||
int
|
int
|
||||||
test ()
|
test ()
|
||||||
{
|
{
|
||||||
|
@ -36,5 +39,10 @@ test ()
|
||||||
int i = 1 | 2 | 4;
|
int i = 1 | 2 | 4;
|
||||||
if (i != 7) return 1;
|
if (i != 7) return 1;
|
||||||
|
|
||||||
|
printf ("global_i=%d\n", global_i);
|
||||||
|
*global_p = 2;
|
||||||
|
printf ("global_i=%d\n", global_i);
|
||||||
|
if (global_i != 2) return global_i;
|
||||||
|
|
||||||
return 2,1,0;
|
return 2,1,0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue