| 1 |
// { dg-module-do run } |
| 2 |
// { dg-additional-options {-fmodules-ts -fdump-lang-module-graph-blocks} } |
| 3 |
|
| 4 |
export module foo; |
| 5 |
// { dg-module-cmi foo } |
| 6 |
|
| 7 |
int i_baz (int i) |
| 8 |
{ |
| 9 |
return i; |
| 10 |
} |
| 11 |
|
| 12 |
inline int baz (int i) |
| 13 |
{ |
| 14 |
return i_baz (i); |
| 15 |
} |
| 16 |
|
| 17 |
int f_baz (float f) |
| 18 |
{ |
| 19 |
return int (f); |
| 20 |
} |
| 21 |
|
| 22 |
inline int baz (float f) |
| 23 |
{ |
| 24 |
return f_baz (f); |
| 25 |
} |
| 26 |
|
| 27 |
export template <typename T> |
| 28 |
int foo (T t) |
| 29 |
{ |
| 30 |
return baz (t); |
| 31 |
} |
| 32 |
|
| 33 |
export inline void user () |
| 34 |
{ |
| 35 |
foo (1); |
| 36 |
foo (1.0f); |
| 37 |
} |
| 38 |
|
| 39 |
// { dg-final { scan-lang-dump {Depending definition function_decl:'::foo<float>'} module } } |
| 40 |
// { dg-final { scan-lang-dump {Depending definition function_decl:'::foo<int>'} module } } |
| 41 |
// { dg-final { scan-lang-dump {\[0\]=specialization definition '::foo<float>'} module } } |
| 42 |
// { dg-final { scan-lang-dump {\[0\]=specialization definition '::foo<int>'} module } } |