aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/guality/pr55665.C
blob: 16c6d2816613b7bae5bf09edb05fca796f484ec4 (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
27
28
29
30
31
32
33
// PR debug/55655
// { dg-do run }
// { dg-options "-g" }

extern "C" void abort ();
struct A { A (int); int a; };

__attribute__((noinline, noclone)) int
bar (void)
{
  return 40;
}

__attribute__((noinline, noclone)) void
foo (int x)
{
  __asm volatile ("" : : "r" (x) : "memory");
}

A::A (int x)
{
  static int p = bar ();
  foo (p);		// { dg-final { gdb-test 23 "p" "40" } }
  a = ++p;
}

int
main ()
{
  A a (42);
  if (a.a != 41)
    abort ();
}