| 1 |
// { dg-additional-options "-fmodules-ts -fdump-lang-module-uid" } |
| 2 |
import bar; |
| 3 |
|
| 4 |
|
| 5 |
int main () |
| 6 |
{ |
| 7 |
if (bar::frob ()) |
| 8 |
return 1; |
| 9 |
if (bar::quux ()) |
| 10 |
return 2; |
| 11 |
|
| 12 |
if (bar::Z (1, 2).frob () != 3) |
| 13 |
return 3; |
| 14 |
|
| 15 |
static_assert (bar::Plain_One (true) == 1); |
| 16 |
static_assert (bar::Plain_One (false) == 2); |
| 17 |
static_assert (int (bar::Scoped_One (true)) == 1); |
| 18 |
static_assert (int (bar::Scoped_One (false)) == 2); |
| 19 |
|
| 20 |
static_assert (bar::Plain_Const_Three == 3); |
| 21 |
static_assert (int (bar::Scoped_Const_Three) == 3); |
| 22 |
|
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
// { dg-final { scan-lang-dump {Lazily binding '::bar::frob'@'bar' section:} module } } |
| 27 |
// { dg-final { scan-lang-dump {>Loading entity foo\[14\] section:4} module } } |
| 28 |
// { dg-final { scan-lang-dump {Named:-[0-9]* namespace_decl:'::foo'@foo} module } } |
| 29 |
// { dg-final { scan-lang-dump {Imported:-[0-9]* function_decl:'::foo::frob@foo:.'@foo} module } } |
| 30 |
|
| 31 |
// { dg-final { scan-lang-dump {Lazily binding '::bar::quux'@'bar' section:} module } } |
| 32 |
// { dg-final { scan-lang-dump {>Loading entity foo\[1\] section:1} module } } |
| 33 |
// { dg-final { scan-lang-dump {Imported:-[0-9]* type_decl:'::foo::X@foo:.'@foo} module } } |
| 34 |
|
| 35 |
// { dg-final { scan-lang-dump {Lazily binding '::bar::Z'@'bar' section:} module } } |
| 36 |
// { dg-final { scan-lang-dump {>Loading entity foo\[8\] section:2} module } } |
| 37 |
// { dg-final { scan-lang-dump {Imported:-[0-9]* type_decl:'::foo::Y@foo:.'@foo} module } } |
| 38 |
// { dg-final { scan-lang-dump {Read member:-[0-9]* field_decl:'::foo::Y@foo:.::_vptr.Y'} module } } |
| 39 |
// { dg-final { scan-lang-dump {Imported:-[0-9]* function_decl:'::foo::Y@foo:.::frob@foo:.'@foo} module } } |
| 40 |
|
| 41 |
// { dg-final { scan-lang-dump {Lazily binding '::bar::Plain_One'@'bar' section:} module } } |
| 42 |
// { dg-final { scan-lang-dump {>Loading entity foo\[13\] section:3} module } } |
| 43 |
// { dg-final { scan-lang-dump {Lazily binding '::bar::Scoped_One'@'bar' section} module } } |
| 44 |
// { dg-final { scan-lang-dump {>Loading entity foo\[15\] section:5} module } } |
| 45 |
// { dg-final { scan-lang-dump-not {Lazily binding '::foo::[ABC]'@'foo' section:} module } } |
| 46 |
// { dg-final { scan-lang-dump-not {Lazily binding '::foo::Scoped@\(foo\)::[ABC]'@'foo' section:} module } } |
| 47 |
|
| 48 |
// { dg-final { scan-lang-dump {Lazily binding '::bar::Plain_Const_Three'@'bar' section:} module } } |
| 49 |
// { dg-final { scan-lang-dump {Lazily binding '::bar::Scoped_Const_Three'@'bar' section} module } } |