aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/expr.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2002-07-19 19:24:43 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-07-19 19:24:43 +0000
commit75aef48add6b3ecf07c6dccee00050162e2058db (patch)
tree62b42c3aa3319f8724a11cbe166c57a37698d77b /gcc/testsuite/gcc.dg/cpp/expr.c
parent72a5503d6216f912f7050bb99ce3cc5adbf57ec1 (diff)
downloadgcc-75aef48add6b3ecf07c6dccee00050162e2058db.zip
gcc-75aef48add6b3ecf07c6dccee00050162e2058db.tar.gz
gcc-75aef48add6b3ecf07c6dccee00050162e2058db.tar.bz2
cppexp.c (ALWAYS_EVAL): Remove.
* cppexp.c (ALWAYS_EVAL): Remove. (optab, reduce): Always evaluate. (num_unary_op, num_binary_op, num_div_op): Issue diagnostics only if not skipping evaluation. testsuite: * gcc.dg/cpp/expr.c: New tests. From-SVN: r55595
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/expr.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/expr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/expr.c b/gcc/testsuite/gcc.dg/cpp/expr.c
new file mode 100644
index 0000000..532bd68
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/expr.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test we get signedness of ?: operator correct. We would skip
+ evaluation of one argument, and might therefore not transfer its
+ unsignedness to the result. */
+
+/* Neil Booth, 19 Jul 2002. */
+
+#if (1 ? -2: 0 + 1U) < 0
+#error /* { dg-bogus "error" } */
+#endif
+
+#if (0 ? 0 + 1U: -2) < 0
+#error /* { dg-bogus "error" } */
+#endif