summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/mangle32.C
blob: 244d07490f84042deff80e2895cd670140bdba60 (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
34
35
36
37
38
39
40
41
42
43
44
// 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();
}