summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c
blob: 73bda118fe58ce81334603812c94ba9055e46021 (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 "-O2 -fdump-tree-optimized" }  */


void *arf ();
int
foo()
{
  void *p = arf ();

  if ((void (*)(void))p != 0)
    return 1;
  else
    return 2;
}

/* The cast to a function pointer type must remain after all optimizations
   are complete so that function pointer canonicalization works on those
   targets which require it.  */
/* { dg-final { scan-tree-dump-times "= \\(void \\(\\*<.*>\\) \\(void\\)\\) p_" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */