aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr49888.c
blob: a0e26cf8327ff3b3d483c238673c21afa28f9fc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* PR debug/49888 */
/* { dg-do run } */
/* { dg-options "-g" } */

static int v;

static void __attribute__((noinline, noclone))
f (int *p)
{
  int c = *p;
  v = c;
  *p = 1; /* { dg-final { gdb-test 12 "!!c" "0" } } */
  /* c may very well be optimized out at this point, so we test !c,
     which will evaluate to the expected value.  We just want to make
     sure it doesn't remain bound to *p as it did before, in which
     case !c would evaluate to 0.  *p may also be regarded as aliasing
     register saves, thus the !!c above.  */
  v = 0; /* { dg-final { gdb-test 18 "!c" "1" } } */
}
int
main ()
{
  int a = 0;
  f (&a);
  return 0;
}