summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr36300-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr36300-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr36300-2.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr36300-2.c b/gcc/testsuite/gcc.dg/pr36300-2.c
new file mode 100644
index 000000000..954333268
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36300-2.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+#define VALUE (unsigned int)((int)((long long)U1 * (long long)3) + 2)
+
+int main(void)
+{
+ long long Y, Y2;
+#if(__SIZEOF_INT__ >= 4)
+ int U1;
+#else
+ long U1;
+#endif
+ unsigned int t;
+
+ U1 = -2147483647-1;
+
+ Y = ((long long)(int)(VALUE * VALUE) * 3);
+
+ t = VALUE;
+ Y2 = ((long long)(int)(t * t) * 3);
+
+ if (Y != Y2)
+ abort ();
+ return 0;
+}