aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-03-24 00:19:06 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-03-24 00:19:06 +0000
commit5a93e8dea1f33a4e6c987974b41835f16163590e (patch)
treeaeadb34f69441cf66a2bb3b585e9419ea7e42c8d /gcc
parentcba4497d926f82d0bceabf206a1ae7b76591bc4e (diff)
downloadgcc-5a93e8dea1f33a4e6c987974b41835f16163590e.zip
gcc-5a93e8dea1f33a4e6c987974b41835f16163590e.tar.gz
gcc-5a93e8dea1f33a4e6c987974b41835f16163590e.tar.bz2
compare8.c: New test case.
* gcc.dg/compare8.c: New test case. Co-Authored-By: Roger Sayle <roger@eyesopen.com> From-SVN: r79891
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/compare8.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8fcef83..9019261 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-23 Joseph S. Myers <jsm@polyomino.org.uk>
+ Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/compare8.c: New test case.
+
2004-03-23 Ziemowit Laski <zlaski@apple.com>
* g++.dg/ext/altivec-7.C: New test.
diff --git a/gcc/testsuite/gcc.dg/compare8.c b/gcc/testsuite/gcc.dg/compare8.c
new file mode 100644
index 0000000..6d04085
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compare8.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+int
+f(unsigned short a1, unsigned short a2, unsigned int b)
+{
+ return ((a1+a2)|5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
+}
+
+int
+g(unsigned short a1, unsigned short a2, unsigned int b)
+{
+ return ((a1+a2)&5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
+}
+