OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [compat/] [init/] [init-ref2_y.C] - Rev 12

Compare with Previous | Blame | View Log

extern int f (void);
extern int r;

const int *p;

void g ()
{
  static const int &i = f();

  // Test that i points to the same place in both calls.
  if (p && p != &i)
    ++r;
  // Test that if so, it points to static data.
  if (i != 42)
    ++r;

  p = &i;
}

void h ()
{
  int arr[] = { 1, 1, 1, 1, 1, 1, 1 };
  g ();
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.