aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/char-compare.c
diff options
context:
space:
mode:
authorJosh Conner <jconner@apple.com>2005-08-08 18:28:46 +0000
committerJosh Conner <jconner@gcc.gnu.org>2005-08-08 18:28:46 +0000
commitbf460b19f02df9a6409ebc8e16ba8a3b17eb1813 (patch)
treef948f1568bfd1c549abaa2bade17a3eb34ffde8e /gcc/testsuite/gcc.dg/char-compare.c
parenta85cb0d7f0ee12bfa2fdb29972783206c8f8e38f (diff)
downloadgcc-bf460b19f02df9a6409ebc8e16ba8a3b17eb1813.zip
gcc-bf460b19f02df9a6409ebc8e16ba8a3b17eb1813.tar.gz
gcc-bf460b19f02df9a6409ebc8e16ba8a3b17eb1813.tar.bz2
re PR rtl-optimization/23241 (Invalid code generated for comparison of uchar to 255)
PR rtl-optimization/23241 * gcc.dg/char-compare.c: New test. From-SVN: r102868
Diffstat (limited to 'gcc/testsuite/gcc.dg/char-compare.c')
-rw-r--r--gcc/testsuite/gcc.dg/char-compare.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/char-compare.c b/gcc/testsuite/gcc.dg/char-compare.c
new file mode 100644
index 0000000..f8b2fb9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/char-compare.c
@@ -0,0 +1,23 @@
+/* PR rtl-optimization/23241 */
+/* Origin: Josh Conner <jconner@apple.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+
+struct fbs {
+ unsigned char uc;
+} fbs1 = {255};
+
+void fn(struct fbs *fbs_ptr)
+{
+ if ((fbs_ptr->uc != 255) && (fbs_ptr->uc != 0))
+ abort();
+}
+
+int main(void)
+{
+ fn(&fbs1);
+ return 0;
+}