Debian Codegraph @

gcc/testsuite/g++.dg/modules/virt-4_a.C

raw
1 // { dg-additional-options "-fmodules-ts" }
2 // Test changes for https://github.com/itanium-cxx-abi/cxx-abi/pull/171
3
4 export module M;
5
6 // Attached to module, should only be emitted in this TU
7 // { dg-final { scan-assembler {_ZTVW1M8Attached:} } }
8 // { dg-final { scan-assembler {_ZTIW1M8Attached:} } }
9 // { dg-final { scan-assembler {_ZTSW1M8Attached:} } }
10 export struct Attached {
11 virtual void key();
12 };
13
14 // Not attached to module, should be emitted where key function is
15 // { dg-final { scan-assembler-not {_ZTV10Unattached:} } }
16 // { dg-final { scan-assembler-not {_ZTI10Unattached:} } }
17 // { dg-final { scan-assembler-not {_ZTS10Unattached:} } }
18 export extern "C++" struct Unattached {
19 // Key function not defined here
20 virtual void key();
21 };
22
23 // Template, should be emitted everywhere it's used
24 export template <typename T> struct Templated {
25 virtual void key() {}
26 };
27
28 // { dg-final { scan-assembler {_ZTVW1M9TemplatedIiE:} } }
29 // { dg-final { scan-assembler {_ZTIW1M9TemplatedIiE:} } }
30 // { dg-final { scan-assembler {_ZTSW1M9TemplatedIiE:} } }
31 static Templated<int> x;