[svn r104] TONS OF FIXES.

Split up declaration, constant initializer gen and definition for globals, structs, classes and functions.
Improved ClassInfo support (not complete), not in vtable yet.
Fixed a bunch of forward reference problems.
Much more. Major commit! :)
This commit is contained in:
Tomas Lindquist Olsen
2007-11-16 08:21:47 +01:00
parent 7d6bbcd87d
commit d1cfe9524c
35 changed files with 1824 additions and 1452 deletions

16
test/arrays13.d Normal file
View File

@@ -0,0 +1,16 @@
module arrays13;
void main()
{
string a = "hello";
assert(a > "hel");
assert(a >= "hel");
assert(a < "helloo");
assert(a <= "helloo");
assert(a > "betty");
assert(a >= "betty");
assert(a == "hello");
assert(a <= "hello");
assert(a >= "hello");
}

View File

@@ -7,4 +7,4 @@ void main()
arr.sort;
writefln("arr.sort = ",arr);
assert(arr == [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
}
}

10
test/bug63.d Normal file
View File

@@ -0,0 +1,10 @@
module bug63;
void main()
{
static void notnested()
{
printf("hello world\n");
}
notnested();
}

5
test/bug66.d Normal file
View File

@@ -0,0 +1,5 @@
module bug66;
import std.stdio;
class Scene { string name() { return "Scene"; } }
class Group : Scene { this () { } }
void main() { writefln((new Group).name); }

View File

@@ -6,5 +6,5 @@ class C
void main()
{
auto ci = C.classinfo;
ClassInfo ci = C.classinfo;
}

15
test/structs7.d Normal file
View File

@@ -0,0 +1,15 @@
module structs7;
pragma(LLVM_internal, "notypeinfo")
struct S
{
int i;
long l;
}
void main()
{
S s = void;
int i = s.i;
long l = s.l;
}

View File

@@ -6,17 +6,18 @@ class C
{
}
void func()
void func(bool b)
{
if (rand() & 1)
if (b)
throw new C;
}
int main()
{
bool b = true;
try
{
func();
func(b);
}
catch(Object)
{

View File

@@ -4,11 +4,11 @@ typedef int int_t;
void main()
{
int_t i;
/*int_t i;
auto ti = typeid(typeof(i));
printf("%s\n",ti.toString.ptr);
assert(ti.toString() == "typeinfo3.int_t");
assert(ti.next !is null);
assert(ti.next.toString() == "int");
assert(ti.init is null);
assert(ti.init is null);*/
}