PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-store-ccp-3.c
blob621fc7cc78d7aa50fee7c9e3b97bcfca9d2f8493
1 /* { dg-do compile } */
2 /* Skipped on MIPS GNU/Linux target because __PIC__ can be
3 defined for executables as well as shared libraries. */
4 /* { dg-skip-if "" { *-*-darwin* hppa*64*-*-* mips*-*-linux* *-*-mingw* } } */
5 /* { dg-options "-O2 -fno-common -fdump-tree-optimized" } */
7 const int conststaticvariable;
9 int f(void)
11 return conststaticvariable;
14 /* There should be no reference for nonpic targets to
15 conststaticvariable as we should have inlined the 0. */
16 /* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized" { target { pie_enabled || nonpic } } } } */
17 /* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized" { target { { ! pie_enabled } && { ! nonpic } } } } } */