aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.0/gcc/testsuite/gcc.dg/pr39867.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.0/gcc/testsuite/gcc.dg/pr39867.c')
-rw-r--r--gcc-4.4.0/gcc/testsuite/gcc.dg/pr39867.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.4.0/gcc/testsuite/gcc.dg/pr39867.c b/gcc-4.4.0/gcc/testsuite/gcc.dg/pr39867.c
new file mode 100644
index 000000000..8f0dbe5ee
--- /dev/null
+++ b/gcc-4.4.0/gcc/testsuite/gcc.dg/pr39867.c
@@ -0,0 +1,11 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+int main (void)
+{
+ int exp = -1;
+ /* Wrong folding of the LHS to an unsigned MAX leads to 4294967295 != 2. */
+ if ((exp < 2 ? 2U : (unsigned int) exp) != 2)
+ link_error ();
+ return 0;
+}