According to the man page -f... options should be passed to gdc.
But:
$ head -1 foo.d
#!/usr/bin/env -S gdmd -run -fmain -fpreview=all -unittest
$ strace -f ./foo.d 2>&1 | grep execve
...
...
execve("/usr/bin/gdc", [""/usr/bin/gdc", "-c", "-main", "-o", "-main.o"]
I had similar issue with not quite documented -main (it works different
than the generic -m... flag passing), which are mentioned in the source
code of gdmd tho.
Digging deeper, and experimenting, it looks like -run must be the last
parameter passed? (Not mentioned in the man page).