dmd/compiler/test/runnable/standalone_modctor.d
Dennis 14ecea9ea7
Add @standalone attribute for module constructors (#15537)
* Add `@__standalone` attribute

* Remove underscores from __standalone
2023-12-22 11:03:03 -08:00

19 lines
302 B
D

// REQUIRED_ARGS: -Irunnable/imports
// EXTRA_SOURCES: imports/standalone_b.d
// PERMUTE_ARGS: -cov
import standalone_b;
import core.attribute : standalone;
immutable int* x;
@standalone @system shared static this()
{
x = new int(1);
}
void main()
{
assert(*x == 1);
assert(*y == 2);
}