Files
ldc/test/classes6.d
Tomas Lindquist Olsen 4eab68b36c [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.
2007-10-02 05:10:18 +02:00

38 lines
368 B
D

module classes6;
class C
{
void f()
{
printf("world\n");
}
}
class D : C
{
void f()
{
printf("moon\n");
}
}
extern(C)
{
void srand(uint seed);
int rand();
}
import llvm.intrinsic;
void main()
{
C c;
srand(readcyclecounter());
if (rand() % 2)
c = new C;
else
c = new D;
c.f();
}