diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c new file mode 100644 index 0000000..0b86524 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-forwprop1" } */ + +int b; +unsigned a; + +static inline int *g(void) +{ + a = 1; + return (int*)&a; +} +void test2(void) +{ + b = *g(); +} + +/* The indirect load should be replaced by a load from a and a + conversion to int. */ + +/* { dg-final { scan-tree-dump "= a;" "forwprop1" } } */ +/* { dg-final { scan-tree-dump "= \\\(int\\\) " "forwprop1" } } */ +/* { dg-final { scan-tree-dump-not "= \\\*" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ |