mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00

* Add predefined version `D_Optimized` when compiling with `-O` So that code can be aware of whether it's compiled with `-O`, e.g., to distinguish between debug and optimized release builds (not necessarily using `-release`). * [update changelog/d_optimized.dd] Co-authored-by: Petar Kirov <petar.p.kirov@gmail.com> Co-authored-by: Petar Kirov <petar.p.kirov@gmail.com>
15 lines
214 B
D
15 lines
214 B
D
/+
|
|
ARG_SETS: -version=Unoptimized
|
|
ARG_SETS: -O
|
|
+/
|
|
|
|
version (Unoptimized)
|
|
{
|
|
version (D_Optimized)
|
|
static assert(0);
|
|
}
|
|
else
|
|
{
|
|
version (D_Optimized) { /* expected */ } else
|
|
static assert(0);
|
|
}
|