[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!

Lots of bugfixes.
Added support for special foreach on strings.
Added std.array, std.utf, std.ctype and std.uni to phobos.
Changed all the .c files in the gen dir to .cpp (it *is* C++ after all)
This commit is contained in:
Tomas Lindquist Olsen
2007-11-03 14:44:58 +01:00
parent 1b867a0588
commit 48492229ec
43 changed files with 4517 additions and 1017 deletions

7
test/arrays10.d Normal file
View File

@@ -0,0 +1,7 @@
module arrays10;
void main()
{
int[] a = new int[10];
a[] = 3;
}

View File

@@ -1,18 +1,29 @@
module arrays7;
pragma(LLVM_internal, "notypeinfo")
struct S
{
int i;
float f;
long l;
void print()
{
printf("%d %f %lx\n", i, f, l);
}
}
void main()
{
S[] arr;
S s;
assert(arr.length == 0);
arr ~= s;
assert(arr.length == 1);
arr ~= S(1,2.64,0xFFFF_FFFF_FFFF);
assert(arr.length == 2);
arr[0].print();
arr[1].print();
assert(arr[1].i == 1);
assert(arr[1].f > 2.63 && arr[1].f < 2.65);
assert(arr[1].l == 0xFFFF_FFFF_FFFF);

8
test/arrays9.d Normal file
View File

@@ -0,0 +1,8 @@
module arrays9;
const int[] g = [1,2,3,4];
void main()
{
}

View File

@@ -10,7 +10,7 @@ void main()
{
S s;
int i = s.i;
int* p = &s.i;
/*int* p = &s.i;
*p = 42;
printf("%d == %d\n", *p, s.i);
@@ -19,5 +19,5 @@ void main()
*f = 3.1415;
printf("%f == %f\n", *f, s.f[0]);
s.f[0] = 123.456;
printf("%f == %f\n", *f, s.f[0]);
printf("%f == %f\n", *f, s.f[0]);*/
}

View File

@@ -19,7 +19,7 @@ void main()
assert((s>>1) == -5);
assert((s>>>1) != -5);
}
{ ushort a = 0xFFF0;
ushort b = 0x0FFF;
auto t = a;
@@ -70,6 +70,6 @@ void main()
s.i &= s.l;
assert(s.i == 0x00FF_FF00);
}
printf(" SUCCESS\n");
}

10
test/bug48.d Normal file
View File

@@ -0,0 +1,10 @@
module bug48;
size_t func(void *p)
{
return cast(size_t)*cast(void* *)p;
}
void main()
{
}

16
test/bug49.d Normal file
View File

@@ -0,0 +1,16 @@
module bug49;
pragma(LLVM_internal, "notypeinfo")
struct S
{
int i;
long l;
}
void main()
{
S s;
s.i = 0x__FFFF_FF00;
s.l = 0xFF00FF_FF00;
s.i &= s.l;
}

28
test/bug50.d Normal file
View File

@@ -0,0 +1,28 @@
module bug50;
pragma(LLVM_internal, "notypeinfo")
struct S
{
int i;
float f;
long l;
void print()
{
printf("%d %f %lx\n", i, f, l);
}
}
void main()
{
S s;
s.print();
s = S(1,2,3);
s.print();
S[] arr;
{arr ~= s;}
{arr[0].print();}
{arr ~= S(1,2,3);}
{arr[1].print();}
}