summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/thunk-retbnd.c
blob: dcce6baf1048391c97e1fe409604d6ec1c8d2a29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile { target { ! x32 } } } */
/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times "return &glob," 2 "optimized" } } */

int glob;

int *
test1 (void)
{
  return &glob;
}

int *
test2 (void)
{
  return test1 ();
}