From 2e391ceb77bda0b095f1e64f07eb0be2d81aa16a Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 4 Nov 2020 00:21:40 +0100 Subject: [PATCH] Add testcase for pr97695 * gcc.c-torture/execute/pr97695.c: New test. --- gcc/testsuite/gcc.c-torture/execute/pr97695.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr97695.c diff --git a/gcc/testsuite/gcc.c-torture/execute/pr97695.c b/gcc/testsuite/gcc.c-torture/execute/pr97695.c new file mode 100644 index 00000000000..36f48b4140c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr97695.c @@ -0,0 +1,20 @@ +int *a, b, **c = &a, d, e; + +int f(int g, int h) { return !h || (g && h == 1) ? 0 : g / h; } + +static void *i(int g) { + while (e < 2) + if (!f(g, 9)) { + while (b) + ; + return 0; + } + return 0; +} + +void j() { + i(1); + *c = i(d); +} + +int main() { j(); return 0; } -- 2.30.2