summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr8715.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-06 16:17:41 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-06 16:17:41 +0000
commit13869a997eacda65a4fc0cd0176a83290c54a819 (patch)
treea1e568cec33c05d17fd32cf2c3885137e848b1ce /gcc/testsuite/gcc.dg/pr8715.c
parent8deb3959b001122f1d9f0f8320adc8bc77844046 (diff)
downloadgcc-13869a997eacda65a4fc0cd0176a83290c54a819.tar.gz
2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 8715 * c-common.c (warn_for_sign_compare): New. Handle separately the case that 'constant' is zero. * c-typeck.c (build_binary_op): Move code to c-common.c cp/ * typeck.c (cp_build_binary_op): Move code to c-common.c. testsuite/ * gcc.dg/pr8715.c: New. * g++.dg/warn/pr8715.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138814 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr8715.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr8715.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr8715.c b/gcc/testsuite/gcc.dg/pr8715.c
new file mode 100644
index 00000000000..e45e77c09f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr8715.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare -std=c99" } */
+
+#include <stdbool.h>
+
+int foo()
+{
+ unsigned char b = '1';
+
+ bool x = ~b; /* { dg-warning "promoted ~unsigned is always non-zero" } */
+
+ return 0;
+}