Add a test for the target independent bug, PR rtl-optimization/111673.
PR rtl-optimization/111673
* gcc.target/i386/pr111673.c: New file.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
--- /dev/null
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -fdump-rtl-pro_and_epilogue" } */
+
+/* Verify there is an early return without the prolog and shrink-wrap
+ the function. */
+
+int f (int);
+int
+advance (int dz)
+{
+ if (dz > 0)
+ return (dz + dz) * dz;
+ else
+ return dz * f (dz);
+}
+
+/* { dg-final { scan-rtl-dump-times "Performing shrink-wrapping" 1 "pro_and_epilogue" } } */