| 1 |
// { dg-additional-options "-fmodules-ts -fdump-lang-module-uid" } |
| 2 |
|
| 3 |
export module bar; |
| 4 |
// { dg-module-cmi bar } |
| 5 |
|
| 6 |
import foo; |
| 7 |
|
| 8 |
namespace bar |
| 9 |
{ |
| 10 |
export int frob (int i = foo::frob (0)) |
| 11 |
{ |
| 12 |
return i; |
| 13 |
} |
| 14 |
|
| 15 |
export int quux (int i = foo::X (0) ) |
| 16 |
{ |
| 17 |
return i; |
| 18 |
} |
| 19 |
|
| 20 |
export class Z : public foo::Y |
| 21 |
{ |
| 22 |
public: |
| 23 |
Z (int i, int j) : X(i), Y(i, j) |
| 24 |
{ |
| 25 |
} |
| 26 |
}; |
| 27 |
|
| 28 |
export constexpr auto Plain_One (bool b) { return b ? foo::B : foo::C; } |
| 29 |
export constexpr auto Scoped_One (bool b) { return b ? foo::Scoped::B |
| 30 |
: foo::Scoped::C; } |
| 31 |
|
| 32 |
export extern auto const Plain_Const_Three = foo::D; |
| 33 |
export extern auto const Scoped_Const_Three = foo::Scoped::D; |
| 34 |
} |
| 35 |
|
| 36 |
// { dg-final { scan-lang-dump {Lazily binding '::foo::frob'@'foo' section:} module } } |
| 37 |
// { dg-final { scan-lang-dump-not {namespace:-[0-9]* namespace_decl:'::foo'} module } } |
| 38 |
// { dg-final { scan-lang-dump {Wrote import:-[0-9]* function_decl:'::foo::frob@foo:.'@foo} module } } |
| 39 |
|
| 40 |
// { dg-final { scan-lang-dump {Lazily binding '::foo::X'@'foo' section:} module } } |
| 41 |
// { dg-final { scan-lang-dump {Wrote import:-[0-9]* type_decl:'::foo::X@foo:.'@foo} module } } |
| 42 |
|
| 43 |
// { dg-final { scan-lang-dump {Lazily binding '::foo::Y'@'foo' section:} module } } |
| 44 |
// { dg-final { scan-lang-dump {Wrote import:-[0-9]* type_decl:'::foo::Y@foo:.'@foo} module } } |
| 45 |
|
| 46 |
// { dg-final { scan-lang-dump {Lazily binding '::foo::B'@'foo' section:} module } } |
| 47 |
// { dg-final { scan-lang-dump-not {Lazily binding '::foo::C@foo:.'@'foo' section:} module } } |
| 48 |
// { dg-final { scan-lang-dump {Lazily binding '::foo::Scoped'@'foo' section:} module } } |
| 49 |
// { dg-final { scan-lang-dump-not {Lazily binding '::foo::Scoped@foo:.::[ABCD]'@'foo' section:} module } } |
| 50 |
|
| 51 |
// { dg-final { scan-lang-dump-times {Wrote import:-[0-9]* type_decl:'::foo::Plain@foo:.'@foo} 2 module } } |
| 52 |
// { dg-final { scan-lang-dump-times {Wrote import:-[0-9]* type_decl:'::foo::Scoped@foo:.'@foo} 2 module } } |