summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c
blob: a0626ea10d934885ead6e77a8ab7683f78d13ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do "compile" } */
/* { dg-options "-fdump-tree-original" } */

typedef int ssize_t __attribute__((mode(pointer)));
ssize_t foo (ssize_t x)
{
  return (ssize_t)(char *)x;
}

char *bar (char *x)
{
  return (char *)(ssize_t)x;
}

/* { dg-final { scan-tree-dump-times "return x;" 2 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */