Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/dmd/glue.d
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,10 @@ void genObjFile(Module m, bool multiobj)
if (global.params.cov)
{
/* Create coverage identifier:
* private uint[numlines] __coverage;
* uint[numlines] __coverage;
*/
m.cov = symbol_calloc("__coverage");
m.cov.Stype = type_fake(TYint);
m.cov.Stype.Tmangle = mTYman_c;
m.cov.Stype.Tcount++;
m.cov.Sclass = SCstatic;
m.cov = toSymbolX(m, "__coverage", SCglobal, type_fake(TYint), "Z");
m.cov.Stype.Tmangle = mTYman_d;
m.cov.Sfl = FLdata;

scope dtb = new DtBuilder();
Expand Down Expand Up @@ -1575,4 +1572,3 @@ elem *toEfilenamePtr(Module m)
Symbol* s = toStringSymbol(id, len, 1);
return el_ptr(s);
}

6 changes: 6 additions & 0 deletions test/runnable/extra-files/lib13742a.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module lib13742a;

void performLocked(alias PROC)()
{
PROC();
}
8 changes: 8 additions & 0 deletions test/runnable/extra-files/lib13742b.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module lib13742b;
import lib13742a;

void clear()
{
void foo() {} // nested function
performLocked!foo; // template from other module (preceding on command line)
}
6 changes: 6 additions & 0 deletions test/runnable/extra-files/test13742.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import lib13742b;

void main()
{
clear();
}
25 changes: 25 additions & 0 deletions test/runnable/test13742.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -x # debug windows issues
set -ueo pipefail

src=runnable${SEP}extra-files
dir=${RESULTS_DIR}${SEP}runnable
output_file=${dir}/test13742.sh.out

if [ $OS == "win32" -o $OS == "win64" ]; then
LIBEXT=.lib
OBJ=.obj
else
LIBEXT=.a
OBJ=.o
fi

$DMD -m${MODEL} -I${src} -lib -cov -of${dir}${SEP}test13742${LIBEXT} ${src}${SEP}lib13742a.d ${src}${SEP}lib13742b.d
$DMD -m${MODEL} -I${src} -cov -of${dir}${SEP}test13742${EXE} ${src}${SEP}test13742.d ${dir}${SEP}test13742${LIBEXT}

${RESULTS_DIR}/runnable/test13742${EXE} --DRT-covopt=dstpath:${dir}${SEP}

rm ${RESULTS_DIR}/runnable/{runnable-extra-files-{lib13742a,lib13742b,test13742}.lst,test13742{${OBJ},${LIBEXT},${EXE}}}

echo Success > ${output_file}