summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pointer-reference-alias.C
blob: 777656d599d74b99a7ad7c4827e26ecbb6bbe121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-optimized" } */

int f(int *a)
{
  int &b = *a;
  b = 0;
  return *a;
}

/* There should be only one dereferencing of a. */
/* { dg-final { scan-tree-dump-times "\\*a" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */