summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
new file mode 100644
index 000000000..fd6b7c812
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* Skipped on MIPS GNU/Linux and IRIX target because __PIC__ can be
+ defined for executables as well as shared libraries. */
+/* { dg-skip-if "" { *-*-darwin* hppa*64*-*-* mips*-*-linux* mips*-*-irix* } { "*" } { "" } } */
+/* { dg-options "-O2 -fno-common -fdump-tree-optimized" } */
+
+const int conststaticvariable;
+
+int f(void)
+{
+ return conststaticvariable;
+}
+
+/* There should be no reference for nonpic targets to
+ conststaticvariable as we should have inlined the 0. */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized" { target nonpic } } } */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized" { target { ! nonpic } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */