testsuite: add testcase for fixed PR115933

gcc/testsuite/ChangeLog:
	PR rtl-optimization/115933

	* gcc.dg/pr115933.c: New test.
This commit is contained in:
Sam James 2024-10-20 08:28:59 +01:00
parent 17d7a4b01a
commit 68e7ced1c7
No known key found for this signature in database
GPG key ID: 738409F520DF9190

View file

@ -0,0 +1,19 @@
/* PR rtl-optimization/115933 */
/* { dg-do run } */
/* { dg-options "-O1 -fno-tree-loop-optimize -ftree-vrp -fno-tree-ch -fgcse" } */
int a, b;
unsigned c() {
int d, e = d = 2;
if (a < 0)
for (e = 0; e < 1; e++)
d = 0;
b = e;
return d;
}
int main() {
c();
if (b != 2)
__builtin_abort();
return 0;
}