@@ -61,15 +61,12 @@ clone_repos
6161# ###############################################################################
6262
6363if [ " $MODEL " == " 64" ] ; then
64- export MODEL_FLAG=" -m64"
6564 MAKE_FILE=" win64.mak"
6665 LIBNAME=phobos64.lib
6766elif [ " $MODEL " == " 32mscoff" ] ; then
68- export MODEL_FLAG=" -m32mscoff"
6967 MAKE_FILE=" win64.mak"
7068 LIBNAME=phobos32mscoff.lib
7169else
72- export MODEL_FLAG=" -m32"
7370 export LIB=" $PWD /dmd2/windows/lib"
7471 MAKE_FILE=" win32.mak"
7572 LIBNAME=phobos.lib
@@ -115,20 +112,22 @@ cd "${DMD_DIR}/../druntime"
115112cd " ${DMD_DIR} /test"
116113
117114if [ " $MODEL " == " 32" ] ; then
118- # Prebuild some tools (run & d_do_test, built by Makefile) with host compiler.
119- " ${GNU_MAKE} " -j1 test_results/run.exe MODEL=" $MODEL " MODEL_FLAG=" $MODEL_FLAG " N=" $N "
120115 # WORKAROUND: Make Optlink use freshly built Phobos, not the host compiler's.
121- # Optlink apparently prefers LIB in sc.ini over the LIB env variable (and `-conf=` for
122- # DMD apparently doesn't prevent that).
123- # rm "$LIB/../bin/sc.ini"
124- cp " ${DMD_DIR} /../phobos/$LIBNAME " .
125- # This also requires to build the remaining tools (sanitize_json & unit_test_runner,
126- # built by run.d, not the Makefile...) with the tested compiler, not the host compiler.
127- " ${GNU_MAKE} " -j1 start_all_tests ARGS=" -O -inline -g" MODEL=" $MODEL " MODEL_FLAG=" $MODEL_FLAG " N=" $N " HOST_DMD=" $DMD_BIN_PATH "
128- else
129- " ${GNU_MAKE} " -j1 start_all_tests ARGS=" -O -inline -g" MODEL=" $MODEL " MODEL_FLAG=" $MODEL_FLAG " N=" $N "
116+ # Optlink apparently prefers LIB in sc.ini over the LIB env variable (and
117+ # `-conf=` for DMD apparently doesn't prevent that).
118+ # There's apparently no sane way to specify a libdir for Optlink in the DMD
119+ # cmdline, so remove the sc.ini file and set the DFLAGS and LIB env variables
120+ # manually for the host compiler. These 2 variables are adapted for the
121+ # actual tests with the tested compiler (by run.d).
122+ HOST_DMD_DIR=" $( cygpath -w " $DMD_DIR /tools/dmd2" ) "
123+ rm " $HOST_DMD_DIR /windows/bin/sc.ini"
124+ export DFLAGS=" -I$HOST_DMD_DIR /src/phobos -I$HOST_DMD_DIR /src/druntime/import"
125+ export LIB=" $HOST_DMD_DIR /windows/lib"
130126fi
131127
128+ " $HOST_DC " -m$MODEL -g -i run.d
129+ ./run --environment --jobs=$N all ARGS=" -O -inline -g" MODEL=" $MODEL "
130+
132131# ###############################################################################
133132# Prepare artifacts
134133# ###############################################################################
0 commit comments