diff options
| author | Michael Matz <matz@suse.de> | 2016-07-13 15:11:40 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-12-15 17:47:08 +0100 |
| commit | 8a1a2a60336264a5f96fae4c7f02424c6928b7c3 (patch) | |
| tree | 7c33a20e1ce519db9e5ce35b63817c1875a66b38 /tccgen.c | |
| parent | 10e4db45dca082b6e936c5540d9f68156b3a8e79 (diff) | |
| download | tinycc-8a1a2a60336264a5f96fae4c7f02424c6928b7c3.tar.gz tinycc-8a1a2a60336264a5f96fae4c7f02424c6928b7c3.tar.bz2 | |
Implement __builtin_choose_expr
Follows GCC implementation.
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -4238,6 +4238,35 @@ ST_FUNC void unary(void) vpushi(is_compatible_types(&type1, &type2)); } break; + case TOK_builtin_choose_expr: + { + int saved_nocode_wanted, c; + next(); + skip('('); + c = expr_const(); + skip(','); + if (!c) { + saved_nocode_wanted = nocode_wanted; + nocode_wanted = 1; + } + expr_eq(); + if (!c) { + vpop(); + nocode_wanted = saved_nocode_wanted; + } + skip(','); + if (c) { + saved_nocode_wanted = nocode_wanted; + nocode_wanted = 1; + } + expr_eq(); + if (c) { + vpop(); + nocode_wanted = saved_nocode_wanted; + } + skip(')'); + } + break; case TOK_builtin_constant_p: { int saved_nocode_wanted, res; |
