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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [abi/] [mangle32.C] - Rev 301

Compare with Previous | Blame | View Log

// Testcase for mangling of unnamed types.

// namespace-scope unnamed types have no linkage, so we only test that they
// are distinct.

// { dg-options -std=c++0x }

typedef struct { } *A;
typedef struct { } *B;

void f(A) { }
void f(B) { }

struct C
{
  typedef struct { }* D;
  typedef enum { }* E;
};

// { dg-final { scan-assembler "_Z2g1PN1CUt_E" } }
void g1(C::D) { }
// { dg-final { scan-assembler "_Z2g2PN1CUt0_E" } }
void g2(C::E) { }

template <class T>
void h1(T t) { }

template <class T>
void h2(T t) { }

inline void j()
{
  typedef enum { }* F;
// { dg-final { scan-assembler "_Z2h1IPZ1jvEUt_EvT_" } }
  h1(F());
  typedef struct { }* G;
// { dg-final { scan-assembler "_Z2h2IPZ1jvEUt0_EvT_" } }
  h2(G());
}

int main()
{
  j();
}

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.