public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6845] testsuite: Add testcase for already fixed PR [PR99739]
@ 2023-03-24 8:41 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2023-03-24 8:41 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:86111e7b3027de1029718e23ee5fab0ee011e191
commit r13-6845-g86111e7b3027de1029718e23ee5fab0ee011e191
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Mar 24 09:39:59 2023 +0100
testsuite: Add testcase for already fixed PR [PR99739]
This PR was fixed by r13-1268-g8c99e307b20, I'm adding testcase
to make sure we don't regress on it in the future.
2023-03-24 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/99739
* gcc.dg/tree-ssa/pr99739.c: New test.
Diff:
---
gcc/testsuite/gcc.dg/tree-ssa/pr99739.c | 40 +++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr99739.c b/gcc/testsuite/gcc.dg/tree-ssa/pr99739.c
new file mode 100644
index 00000000000..3ebaa4bb4ff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr99739.c
@@ -0,0 +1,40 @@
+/* PR tree-optimization/99739 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "__builtin_abort \\\(\\\);" "optimized" } } */
+
+static inline int
+foo (int i, int j, int k)
+{
+ int x = 1;
+ if (i && j && k)
+ x = 2;
+ if (i && j && k)
+ return x;
+ return -1;
+}
+
+void
+bar (int i, int j, int k)
+{
+ if (foo (i, j, k) == 1)
+ __builtin_abort ();
+}
+
+static inline int
+baz (int i, int j, int k)
+{
+ int x = 1;
+ if (i && j && k)
+ x = 2;
+ if (i && k && j)
+ return x;
+ return -1;
+}
+
+void
+qux (int i, int j, int k)
+{
+ if (baz (i, j, k) == 1)
+ __builtin_abort ();
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-24 8:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 8:41 [gcc r13-6845] testsuite: Add testcase for already fixed PR [PR99739] Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).