Skip to content

Commit

Permalink
fix Issue 9377 - Link-failure regression cause by fixing issue 8504
Browse files Browse the repository at this point in the history
The test is disabled only in win64 platform.
  • Loading branch information
9rnsr committed Jan 24, 2013
1 parent 3d5528e commit 6a0be5b
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,14 @@ Type *functionParameters(Loc loc, Scope *sc, TypeFunction *tf,
{
fd->functionSemantic();
}
else if (fd && fd->parent)
{
TemplateInstance *ti = fd->parent->isTemplateInstance();
if (ti && ti->tempdecl)
{
fd->functionSemantic3();
}
}

size_t n = (nargs > nparams) ? nargs : nparams; // n = max(nargs, nparams)

Expand Down
1 change: 1 addition & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ DISABLED_TESTS += testargtypes
DISABLED_TESTS += testxmm

DISABLED_SH_TESTS += test39
DISABLED_SH_TESTS += test9377
endif

runnable_tests=$(wildcard runnable/*.d) $(wildcard runnable/*.sh)
Expand Down
11 changes: 11 additions & 0 deletions test/runnable/extra-files/mul9377a.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import std.c.stdio;

import mul9377b;

void abc()
{
printf("mul9377b.abc()\n");
foo();
bar();
}

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

import std.c.stdio;

int j;

int foo()()
{
printf("foo()\n");
static int z = 7;
assert(z != 10);
return ++z;
}

void bar()
{
assert(j == 7);
foo();
printf("bar\n");
}

template def()
{
alias int defint;

static this()
{
printf("def.static this()\n");
j = 7;
}

//void mem(int){}
void mem()
{
printf("def().mem()\n");
}
}

def!().defint x;

13 changes: 13 additions & 0 deletions test/runnable/extra-files/multi9377.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import std.c.stdio;

import mul9377a, mul9377b;

int main()
{
printf("main\n");
abc();
def!().mem();
pragma(msg, def!().mem.mangleof);
return 0;
}

17 changes: 17 additions & 0 deletions test/runnable/test9377.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

src=runnable${SEP}extra-files
dir=${RESULTS_DIR}${SEP}runnable

if [ $OS == "win32" -o $OS == "win64" ]; then
LIBEXT=.lib
else
LIBEXT=.a
fi
libname=${dir}${SEP}lib9377${LIBEXT}

$DMD -m${MODEL} -I${src} -of${libname} -c ${src}${SEP}mul9377a.d ${src}${SEP}mul9377b.d -lib
$DMD -m${MODEL} -I${src} -of${dir}${SEP}mul9377 ${src}${SEP}multi9377.d ${libname}

rm ${dir}/{lib9377${LIBEXT},mul9377${OBJ},mul9377${EXE}}

0 comments on commit 6a0be5b

Please sign in to comment.