mescc: Fix struct field comparison.

* module/language/c99/compiler.mes (expr->accu, ast->info): Some
  push/pop fixes, fixes struct field comparisons.
* doc/examples/t.c (struct_test): Test it.
This commit is contained in:
Jan Nieuwenhuizen 2017-03-22 07:10:54 +01:00
parent 9a02352a15
commit bcf1b2a356
2 changed files with 15 additions and 2 deletions

View file

@ -805,7 +805,8 @@ _)))))
(list (lambda (f g ta t d)
(i386:push-base)))
(.text accu)
(i386:pop-accu)
(list (lambda (f g ta t d)
(i386:pop-base)))
(list (lambda (f g ta t d)
(i386:sub-base)))))))
@ -1619,7 +1620,8 @@ _)))))
(list (lambda (f g ta t d)
(i386:push-base)))
(.text accu)
(i386:pop-accu)
(list (lambda (f g ta t d)
(i386:pop-base)))
(list (lambda (f g ta t d)
(i386:sub-base)))))))
@ -1680,6 +1682,8 @@ _)))))
(list (lambda (f g ta t d)
(i386:push-base)))
(.text accu)
(list (lambda (f g ta t d)
(i386:pop-base)))
(list (lambda (f g ta t d)
(i386:base-sub)))))))
@ -1693,6 +1697,8 @@ _)))))
(list (lambda (f g ta t d)
(i386:push-base)))
(.text accu)
(list (lambda (f g ta t d)
(i386:pop-base)))
(list (lambda (f g ta t d)
(i386:base-sub)))))))

View file

@ -228,6 +228,13 @@ make_tmps_test (struct scm* cells)
int
struct_test ()
{
g_cells[0].type = TNUMBER;
g_cells[1].type = TNUMBER;
puts ("t: TYPE (0) != TYPE (1)\n");
if (TYPE (0) == TYPE (1)) goto ok;
return 1;
ok:
g_cells[0].car = 1;
g_cells[1].car = 2;