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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [debug/] [dwarf2/] [static-local-var-in-ctor.C] - Rev 826

Compare with Previous | Blame | View Log

// PR debug/39372
// { dg-do compile }
// { dg-options "-O0 -g -dA" }
// { dg-final { scan-assembler "DW_OP_addr\[^\n\r\]*\[\n\r\]*\[^\n\r\]*staticvar1" } }
// { dg-final { scan-assembler "DW_OP_addr\[^\n\r\]*\[\n\r\]*\[^\n\r\]*staticvar2" } }

extern void f (int *);

struct A
{
  A(int i);
  void foo(int i);
};

A::A(int i)
{
  static int *staticvar1 = new int(i);
  f (staticvar1);
}

void A::foo(int i)
{
  static int *staticvar2 = new int(i);
  f (staticvar2);
}

void f (int *)
{
}

int
main (void)
{
  A a(42);
  a.foo(42);
  return 0;
}

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.