| 1 |
// { dg-additional-options "-fmodules" } |
| 2 |
|
| 3 |
import "extern-tpl-4_a.H"; |
| 4 |
import M; |
| 5 |
|
| 6 |
int main() { |
| 7 |
ha<int>(); |
| 8 |
ha<char>(); |
| 9 |
ha<double>(); |
| 10 |
|
| 11 |
ma<int>(); |
| 12 |
ma<char>(); |
| 13 |
ma<double>(); |
| 14 |
|
| 15 |
hb<int>(); |
| 16 |
hb<char>(); |
| 17 |
hb<double>(); |
| 18 |
|
| 19 |
mb<int>(); |
| 20 |
mb<char>(); |
| 21 |
mb<double>(); |
| 22 |
|
| 23 |
int x1 = hc<int> + hc<char> + hc<double>; |
| 24 |
int x2 = hd<int> + hd<char> + hd<double>; |
| 25 |
int x3 = mc<int> + mc<char> + mc<double>; |
| 26 |
int x4 = md<int> + md<char> + md<double>; |
| 27 |
return x1 + x2 + x3 + x4; |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
// 'int': imported explicit instantiation decls should not be emitted here: |
| 32 |
// { dg-final { scan-assembler-not "_Z2haIiEvv:" } } |
| 33 |
// { dg-final { scan-assembler-not "_Z2hbIiEvv:" } } |
| 34 |
// { dg-final { scan-assembler-not "_Z2hcIiE:" } } |
| 35 |
// { dg-final { scan-assembler-not "_Z2hdIiE:" } } |
| 36 |
// { dg-final { scan-assembler-not "_ZW1M2maIiEvv:" } } |
| 37 |
// { dg-final { scan-assembler-not "_ZW1M2mbIiEvv:" } } |
| 38 |
// { dg-final { scan-assembler-not "_ZW1M2mcIiE:" } } |
| 39 |
// { dg-final { scan-assembler-not "_ZW1M2mdIiE:" } } |
| 40 |
|
| 41 |
// 'char': explicit instantiation definitions don't need to be emitted for |
| 42 |
// modules, but need to be emitted for header units (as there's no other TU): |
| 43 |
// { dg-final { scan-assembler "_Z2haIcEvv:" } } |
| 44 |
// { dg-final { scan-assembler "_Z2hbIcEvv:" } } |
| 45 |
// { dg-final { scan-assembler "_Z2hcIcE:" } } |
| 46 |
// { dg-final { scan-assembler "_Z2hdIcE:" } } |
| 47 |
// { dg-final { scan-assembler-not "_ZW1M2maIcEvv:" } } |
| 48 |
// { dg-final { scan-assembler-not "_ZW1M2mbIcEvv:" } } |
| 49 |
// { dg-final { scan-assembler-not "_ZW1M2mcIcE:" } } |
| 50 |
// { dg-final { scan-assembler-not "_ZW1M2mdIcE:" } } |
| 51 |
|
| 52 |
// 'double': these are not explicitly instantiated and should be emitted here: |
| 53 |
// { dg-final { scan-assembler "_Z2haIdEvv:" } } |
| 54 |
// { dg-final { scan-assembler "_Z2hbIdEvv:" } } |
| 55 |
// { dg-final { scan-assembler "_Z2hcIdE:" } } |
| 56 |
// { dg-final { scan-assembler "_Z2hdIdE:" } } |
| 57 |
// { dg-final { scan-assembler "_ZW1M2maIdEvv:" } } |
| 58 |
// { dg-final { scan-assembler "_ZW1M2mbIdEvv:" } } |
| 59 |
// { dg-final { scan-assembler "_ZW1M2mcIdE:" } } |
| 60 |
// { dg-final { scan-assembler "_ZW1M2mdIdE:" } } |
| 61 |
|
| 62 |
template void ha<bool>(); |
| 63 |
template void hb<bool>(); |
| 64 |
template int hc<bool>; |
| 65 |
template int hd<bool>; |
| 66 |
|
| 67 |
template void ma<bool>(); |
| 68 |
template void mb<bool>(); |
| 69 |
template int mc<bool>; |
| 70 |
template int md<bool>; |
| 71 |
|
| 72 |
// 'bool': instantiated in this file, and so must be emitted here: |
| 73 |
// { dg-final { scan-assembler "_Z2haIbEvv:" } } |
| 74 |
// { dg-final { scan-assembler "_Z2hbIbEvv:" } } |
| 75 |
// { dg-final { scan-assembler "_Z2hcIbE:" } } |
| 76 |
// { dg-final { scan-assembler "_Z2hdIbE:" } } |
| 77 |
// { dg-final { scan-assembler "_ZW1M2maIbEvv:" } } |
| 78 |
// { dg-final { scan-assembler "_ZW1M2mbIbEvv:" } } |
| 79 |
// { dg-final { scan-assembler "_ZW1M2mcIbE:" } } |
| 80 |
// { dg-final { scan-assembler "_ZW1M2mdIbE:" } } |