[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.

* Now 50/51 tests compile.
* Added a simple runalltests.d scripts that should be run with 'gdmd -run runalltests.d' - LLVMDC will not compile it yet.
This commit is contained in:
Tomas Lindquist Olsen
2007-10-02 05:10:18 +02:00
parent e1a8afb028
commit 4eab68b36c
19 changed files with 205 additions and 71 deletions

View File

@@ -4,12 +4,34 @@ class C
{
void f()
{
printf("hello world\n");
printf("world\n");
}
}
class D : C
{
void f()
{
printf("moon\n");
}
}
extern(C)
{
void srand(uint seed);
int rand();
}
import llvm.intrinsic;
void main()
{
scope c = new C;
C c;
srand(readcyclecounter());
if (rand() % 2)
c = new C;
else
c = new D;
c.f();
}

21
test/classes7.d Normal file
View File

@@ -0,0 +1,21 @@
module classes7;
class C
{
int i=0;
void f()
{
i=42;
}
void g()
{
f();
}
}
void main()
{
scope c = new C;
c.g();
assert(c.i == 43);
}