diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c new file mode 100644 index 00000000000..63febd0e04f --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-ccp1" } */ + +/* Make sure CCP propagates through indirect calls. */ + +int foo (void) +{ + int i = -5; + int (*fn)(int) = __builtin_abs; + int j = fn(i); + return j + 5; +} + +/* { dg-final { scan-tree-dump "return 10;" "ccp1" } } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ |