aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c
new file mode 100644
index 000000000..3a96786fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c
@@ -0,0 +1,18 @@
+/* PR optimization/11210 */
+/* Originator: Guido Classen <guido@clagi.de> */
+/* Reduced testcase by Falk Hueffner <falk@debian.org> */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+/* Verify that the constant expressions folder doesn't
+ throw away the cast operation in the comparison. */
+
+struct str {
+ int head;
+ signed char data[8];
+};
+
+int foo(struct str t)
+{
+ return t.data[0] || (unsigned char) t.data[2] != 130; /* { dg-bogus "comparison is always 1" } */
+}