aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
blob: 0b865245a9659497a5358c349529e914cd9cc2bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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" } } */