mescc: Tinycc support: Fix for ?-operator.

This commit is contained in:
Jan Nieuwenhuizen 2018-05-11 15:13:55 +02:00
parent 70cb56025f
commit e3a8316184
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
3 changed files with 14 additions and 7 deletions

View file

@ -222,7 +222,6 @@ broken="$broken
28_strings
31_args
32_led
34_array_assignment
37_sprintf
38_multiple_array_index

View file

@ -305,15 +305,15 @@
(let ((rank (pointer->rank pointer)))
(rank+= (ast->type type info) rank)))
((decl-spec-list (type-spec ,type))
(ast->type type info))
((decl-spec-list (type-spec ,type)) (ast->type type info))
;; `typedef int size; void foo (unsigned size u)
;; ;; `typedef int size; void foo (unsigned size u)
((decl-spec-list (type-spec ,type) (type-spec ,type2))
(ast->type type info))
((assn-expr ,a ,op ,b)
(ast->type a info))
((assn-expr ,a ,op ,b) (ast->type a info))
((cond-expr _ ,a ,b) (ast->type a info))
(_ (get-type o info))))

View file

@ -21,6 +21,11 @@
#include "30-test.i"
#include <stdio.h>
union foo
{
int i;
};
int
test ()
{
@ -33,7 +38,10 @@ test ()
(one == 1) ? 1 : exit (1);
puts ("t: (f) ?\n");
(f) ? exit (1) : 1;
(f) ? exit (2) : 1;
union foo fu;
fu.i = 1 ? 0 : 1;
return 0;
}