public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-3642] Add gcc.dg/tree-ssa/modref-3.c testcase
@ 2020-10-03 15:21 Jan Hubicka
0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2020-10-03 15:21 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a1f77106ec3f0005f0cfd3e1d083837afeb432f6
commit r11-3642-ga1f77106ec3f0005f0cfd3e1d083837afeb432f6
Author: Jan Hubicka <jh@suse.cz>
Date: Sat Oct 3 17:20:54 2020 +0200
Add gcc.dg/tree-ssa/modref-3.c testcase
* gcc.dg/tree-ssa/modref-3.c: New test.
Diff:
---
gcc/testsuite/gcc.dg/tree-ssa/modref-3.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/modref-3.c b/gcc/testsuite/gcc.dg/tree-ssa/modref-3.c
new file mode 100644
index 00000000000..668c6c28831
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/modref-3.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+struct a
+{
+ int b;
+ int c;
+};
+
+__attribute__ ((noclone, noinline))
+void
+test (struct a *a)
+{
+ a->b = 2;
+}
+int
+foo ()
+{
+ struct a a = {113,114};
+ test (&a);
+ return a.c;
+}
+int
+foo2 (struct a *a)
+{
+ a->b = 123;
+ a->c = 124;
+ test (a);
+ return a->c;
+}
+/* { dg-final { scan-tree-dump "return 114" "optimized"} } */
+/* { dg-final { scan-tree-dump "return 124" "optimized"} } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-03 15:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03 15:21 [gcc r11-3642] Add gcc.dg/tree-ssa/modref-3.c testcase Jan Hubicka
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).