The default supplied main function as read when compiling with `-fmain'
has extern(D) linkage. However this does not work when mixing this
option together with `-fno-druntime'.
PR d/102476
gcc/testsuite/ChangeLog:
* gdc.dg/pr102476.d: New test.
libphobos/ChangeLog:
* libdruntime/__main.di: Define main function as extern(C) when
compiling without D runtime.
--- /dev/null
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102476
+// { dg-do link }
+// { dg-options "-fmain -fno-druntime" }
module __main;
-int main(char[][])
+version (D_BetterC)
{
- return 0;
+ extern (C) int main(int, char**)
+ {
+ return 0;
+ }
+}
+else
+{
+ int main(char[][])
+ {
+ return 0;
+ }
}