| 1 |
// PR c++/118278 |
| 2 |
// Verify that class literals are mangled the same way regardless |
| 3 |
// of the underlying type. |
| 4 |
// { dg-do compile { target c++20 } } |
| 5 |
// { dg-additional-options -fabi-compat-version=0 } |
| 6 |
|
| 7 |
struct I { int a[5], b[5], c[144]; }; |
| 8 |
template <I> struct X { }; |
| 9 |
|
| 10 |
typedef X<I{ {1,2}, {}, { |
| 11 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 12 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 13 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 14 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 15 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 16 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 17 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 18 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 19 |
101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }> Ti; |
| 20 |
void f (Ti) { } |
| 21 |
// { dg-final { scan-assembler "_Z1f1XIXtl1ItlA5_iLi1ELi2EEtlS1_EtlA144_i(?:Li101ELi102ELi103ELi104ELi105ELi106ELi255ELi254ELi253ELi252ELi251ELi0ELi1ELi2ELi3ELi4E){8}Li101ELi102EEEEE" } } |
| 22 |
|
| 23 |
struct C { unsigned char a[5], b[5], c[144]; }; |
| 24 |
template <C> struct Y { }; |
| 25 |
|
| 26 |
typedef Y<C{ {1,2}, {}, { |
| 27 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 28 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 29 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 30 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 31 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 32 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 33 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 34 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 35 |
101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }> Tca; |
| 36 |
void g (Tca) { } |
| 37 |
// { dg-final { scan-assembler "_Z1g1YIXtl1CtlA5_hLh1ELh2EEtlS1_EtlA144_h(?:Lh101ELh102ELh103ELh104ELh105ELh106ELh255ELh254ELh253ELh252ELh251ELh0ELh1ELh2ELh3ELh4E){8}Lh101ELh102EEEEE" } } |
| 38 |
|
| 39 |
typedef Y<C{ "\1\2", "", { |
| 40 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 41 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 42 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 43 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 44 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 45 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 46 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 47 |
101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, |
| 48 |
101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }> Tcs; |
| 49 |
void h (Tcs) { } |
| 50 |
// { dg-final { scan-assembler "_Z1h1YIXtl1CtlA5_hLh1ELh2EEtlS1_EtlA144_h(?:Lh101ELh102ELh103ELh104ELh105ELh106ELh255ELh254ELh253ELh252ELh251ELh0ELh1ELh2ELh3ELh4E){8}Lh101ELh102EEEEE" } } |
| 51 |
|
| 52 |
struct S { signed char a[5], b[5], c[144]; }; |
| 53 |
template <S> struct Z { }; |
| 54 |
|
| 55 |
typedef Z<S{ {1,2}, {}, { |
| 56 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 57 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 58 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 59 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 60 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 61 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 62 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 63 |
101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, |
| 64 |
101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }> Tsc; |
| 65 |
|
| 66 |
void i (Tsc) { } |
| 67 |
// { dg-final { scan-assembler "_Z1i1ZIXtl1StlA5_aLa1ELa2EEtlS1_EtlA144_a(?:La101ELa102ELa103ELa104ELa105ELa106ELa95ELa94ELa93ELa92ELa91ELa0ELa1ELa2ELa3ELa4E){8}La101ELa102EEEEE" } } |