Debian Codegraph @

gcc/testsuite/g++.dg/abi/comdat3.C

raw
1 // PR lto/113208
2 // { dg-do compile { target { c++11 && { *-*-*gnu* } } } }
3 // { dg-additional-options "-O2" }
4 // { dg-final { scan-assembler "_ZN1M1SINS_1P1TELN1N1LE2EEC5Ev,comdat" } }
5 // { dg-final { scan-assembler-not "_ZN1M1SINS_1P1TELN1N1LE2EEC1Ev,comdat" } }
6 // { dg-final { scan-assembler-not "_ZN1M1SINS_1P1TELN1N1LE2EEC2Ev,comdat" } }
7
8 namespace N { enum L { L1, L2, L3 } const O = L3; }
9 namespace M {
10 using N::O;
11 using N::L;
12 template <typename, L = O>
13 struct S { constexpr S () {} };
14 namespace P {
15 struct T;
16 struct U { S<T> u; };
17 void foo () { U (); }
18 }
19 extern template class S<P::T>;
20 }
21 namespace p = M::P;
22 template class M::S<p::T>;