aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-07-02 17:16:08 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2009-07-02 15:16:08 +0000
commit3c1832c328ea48a8acb567200cf511b82b020835 (patch)
treeafc09716b9b13b4e1dbaa69981eb6f73f7f2a076 /gcc/testsuite/gcc.dg/tree-ssa
parent92355a9cf2a71640db076953161aab1b1595d92b (diff)
downloadgcc-3c1832c328ea48a8acb567200cf511b82b020835.zip
gcc-3c1832c328ea48a8acb567200cf511b82b020835.tar.gz
gcc-3c1832c328ea48a8acb567200cf511b82b020835.tar.bz2
local-pure-const.c: New testcase.
* gcc.dg/tree-ssa/local-pure-const.c: New testcase. * ipa-pure-const.c (check_op): Use PTA info to see if indirect_ref is local. From-SVN: r149176
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
new file mode 100644
index 0000000..2c7353d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-local-pure-const1" } */
+t(int a, int b, int c)
+{
+ int *p;
+ if (a)
+ p = &a;
+ else
+ p = &c;
+ return *p;
+}
+/* { dg-final { scan-tree-dump-times "local memory is OK" 1 "local-pure-const1"} } */
+/* { dg-final { scan-tree-dump-times "found to be const" 1 "local-pure-const1"} } */
+/* { dg-final { cleanup-tree-dump "local-pure-const1" } } */