tree-optimization/111383 - testcase for fixed PR

Message ID 20231020135259.F1B4613584@imap2.suse-dmz.suse.de
State Accepted
Headers
Series tree-optimization/111383 - testcase for fixed PR |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Richard Biener Oct. 20, 2023, 1:52 p.m. UTC
  Pushed.

	PR tree-optimization/111383
	PR tree-optimization/110243
gcc/testsuite/
	* gcc.dg/torture/pr111383.c: New testcase.
---
 gcc/testsuite/gcc.dg/torture/pr111383.c | 29 +++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/torture/pr111383.c
  

Patch

diff --git a/gcc/testsuite/gcc.dg/torture/pr111383.c b/gcc/testsuite/gcc.dg/torture/pr111383.c
new file mode 100644
index 00000000000..cce873ba7ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr111383.c
@@ -0,0 +1,29 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+int a, d = 1625015426;
+char e;
+short b;
+short *f = &b, *g = &b;
+void h(char *k) {
+  char c = *k;
+  for (; c;)
+    ;
+}
+int main()
+{
+  *g = 25330;
+  int i, j;
+  i = 0;
+  for (; *f + d - 1625040257 < 7;)
+    ;
+  for (; i < 4; i++) {
+    j = 0;
+    for (; (d - 1625015511) + (d - 1625015341) + j < 1; j++)
+      h(&e);
+  }
+  if (a != 0)
+    abort ();
+  return 0;
+}