www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16440] New: wrong code with -main -c -of

https://issues.dlang.org/show_bug.cgi?id=16440

          Issue ID: 16440
           Summary: wrong code with -main -c -of
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

Found when working on rdmd.

test.d.

----
import std.stdio;
static this() { writeln("static this"); }
unittest { writeln("unittest"); }
----

Prints nothing, should print "static this" and "unittest":

----
dmd -main -c -oftest.o -unittest test.d
dmd test.o
./test
----

--
Aug 28 2016