mirror of
https://github.com/mirror/tinycc.git
synced 2026-09-03 12:12:46 +08:00
Rework expr_infix
- revert const-folding in gvtst() and put it back into expr_landor(). Although it did make sense, one reason not to do it is __builtin_constant_p() which may return true when it shouldn't because of nocode_wanted, see test. - tccgen_init() can do init_prec(), also for tcc -E. - for nostalgic reasons, keep the original expression parser functions in the source. - Makefile: remove stale stuff
This commit is contained in:
@@ -3736,6 +3736,9 @@ void builtin_test(void)
|
||||
printf("res = %d\n", __builtin_constant_p(1));
|
||||
printf("res = %d\n", __builtin_constant_p(1 + 2));
|
||||
printf("res = %d\n", __builtin_constant_p(&constant_p_var));
|
||||
printf("res = %d\n", __builtin_constant_p(constant_p_var));
|
||||
printf("res = %d\n", __builtin_constant_p(100000 / constant_p_var));
|
||||
printf("res = %d\n", __builtin_constant_p(i && 0));
|
||||
printf("res = %d\n", __builtin_constant_p(i && 1));
|
||||
printf("res = %d\n", __builtin_constant_p(i && 0 ? i : 34));
|
||||
s = 1;
|
||||
|
||||
Reference in New Issue
Block a user