| 1 |
// Verify that class literals are mangled the same way regardless |
| 2 |
// of the underlying type. |
| 3 |
// { dg-do compile { target c++2a } } |
| 4 |
// { dg-additional-options -fabi-compat-version=0 } |
| 5 |
|
| 6 |
struct I { int a[5], b[5], c[5]; }; |
| 7 |
template <I> struct X { }; |
| 8 |
|
| 9 |
typedef X<I{ {1,2}, {}, {11,12,13,14} }> Ti; |
| 10 |
void f (Ti) { } |
| 11 |
// { dg-final { scan-assembler "_Z1f1XIXtl1ItlA5_iLi1ELi2EEtlS1_EtlS1_Li11ELi12ELi13ELi14EEEEE" } } |
| 12 |
|
| 13 |
struct C { char a[5], b[5], c[5]; }; |
| 14 |
template <C> struct Y { }; |
| 15 |
|
| 16 |
typedef Y<C{ {1,2}, {}, {11,12,13,14} }> Tca; |
| 17 |
void g (Tca) { } |
| 18 |
// { dg-final { scan-assembler "_Z1g1YIXtl1CtlA5_cLc1ELc2EEtlS1_EtlS1_Lc11ELc12ELc13ELc14EEEEE" } } |
| 19 |
|
| 20 |
typedef Y<C{ "\1\2", "", {11,12,13,14} }> Tcs; |
| 21 |
void h (Tcs) { } |
| 22 |
// { dg-final { scan-assembler "_Z1h1YIXtl1CtlA5_cLc1ELc2EEtlS1_EtlS1_Lc11ELc12ELc13ELc14EEEEE" } } |
| 23 |
|
| 24 |
struct S { signed char a[5], b[5], c[5]; }; |
| 25 |
template <S> struct Z { }; |
| 26 |
|
| 27 |
typedef Z<S{ {1,2}, {}, {11,12,13,14} }> Tsc; |
| 28 |
|
| 29 |
void i (Tsc) { } |
| 30 |
// { dg-final { scan-assembler "_Z1i1ZIXtl1StlA5_aLa1ELa2EEtlS1_EtlS1_La11ELa12ELa13ELa14EEEEE" } } |