summaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-26 18:42:21 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-26 18:42:21 +0000
commitb444d47a3eb7c70492702b498da24bdcdee18148 (patch)
treee0b28595be44974817fef680c5e031a4b195ef68 /gcc/cpplib.c
parent235d7594b104d4c89bd12bdfa44efbe50d7a5ff2 (diff)
downloadgcc-b444d47a3eb7c70492702b498da24bdcdee18148.tar.gz
* cppexp.c (possible_sum_sign, integer_overflow, left_shift,
right_shift): Remove. (cpp_num, cpp_num_part, PART_PRECISION, HALF_MASK, LOW_PART, HIGH_PART): New. (struct op): Use cpp_num. (num_zerop, num_eq, num_positive, num_greater_freq, num_trim, num_part_mul, num_unary_op, num_binary_op, num_negate, num_bitwise_op, num_inequality_op, num_equality_op, num_mul, num_div_op, num_lshift, num_rshift, append_digit): New. (interpret_number, parse_defined, eval_token, reduce): Update for two-integer arithmetic. (binary_handler): New typedef. (optab): Update. (COMPARE, EQUALITY, BITWISE, MINMAX, UNARY, SHIFT): Delete. (_cpp_parse_expr, reduce): Update to handle two-integers. * cpplib.c (_cpp_test_assertion): Back up on CPP_EOF. testsuite: * gcc.dg/cpp/arith-1.c: New semantic tests. * gcc.dg/cpp/if-1.c: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53900 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index ba6924d08ec..e819ffca4d0 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1652,6 +1652,8 @@ _cpp_test_assertion (pfile, value)
if (node)
*value = (node->type == NT_ASSERTION &&
(answer == 0 || *find_answer (node, answer) != 0));
+ else if (pfile->cur_token[-1].type == CPP_EOF)
+ _cpp_backup_tokens (pfile, 1);
/* We don't commit the memory for the answer - it's temporary only. */
return node == 0;