summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c
blob: 08b827c1d3b50c99256e050d2c5299fa34d93e27 (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" } } */