changeset 270:d9d5d59873d8 trunk

[svn r291] Fixed a bunch of the old Phobos tests to work with Tango. Branch statements now emit a new block after it. Fixed the _adSort runtime function had a bad signature. Added a missing dot prefix on compiler generated string tables for string switch. Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author lindquist
date Mon, 16 Jun 2008 16:01:19 +0200
parents 967178e31a13
children 1e6e2b5d5bfe
files dmd/mtype.c gen/statements.cpp tango/lib/compiler/llvmdc/memory.d tango/lib/compiler/llvmdc/qsort2.d test/a.d test/aa3.d test/aa6.d test/alloca1.d test/b.d test/bitops.d test/bug10.d test/bug12.d test/bug20.d test/bug21.d test/bug22.d test/bug23.d test/bug24.d test/bug25.d test/bug29.d test/bug32.d test/bug50.d test/bug55.d test/bug60.d test/bug61.d test/bug62.d test/bug63.d test/bug77.d test/bug80.d test/bug9.d test/calls1.d test/classes.d test/classes11.d test/classes2.d test/classes4.d test/classes5.d test/classes6.d test/classinfo1.d test/cond.d test/dgs.d test/dotproduct.d test/e.d test/floatcmp.d test/foreach1.d test/foreach2.d test/foreach3.d test/foreach4.d test/foreach5.d test/funcptr.d test/funcs.d test/g.d test/globals1.d test/innerclass1.d test/mainargs1.d test/moduleinfo1.d test/moduleinfo2.d test/multiarr4.d test/nested5.d test/nested6.d test/nested7.d test/nested8.d test/nested9.d test/pt.d test/ptrarith.d test/scope1.d test/scope2.d test/scope3.d test/sieve.d test/sqrts.d test/static_ctor.d test/staticarrays.d test/strings1.d test/switch2.d test/switch3.d test/typeinfo.d test/typeinfo7.d test/typeinfo8.d test/unrolled.d test/v2d.d test/vararg1.d test/vararg3.d test/vararg4.d test/vararg5.d test/virtcall.d
diffstat 83 files changed, 141 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/mtype.c	Sun Jun 15 18:57:11 2008 +0200
+++ b/dmd/mtype.c	Mon Jun 16 16:01:19 2008 +0200
@@ -223,16 +223,18 @@
 
     tvoidptr = tvoid->pointerTo();
 
-    // set size_t / ptrdiff_t types
+    // set size_t / ptrdiff_t types and pointer size
     if (global.params.is64bit)
     {
     Tsize_t = Tuns64;
     Tptrdiff_t = Tint64;
+    PTRSIZE = 8;
     }
     else
     {
     Tsize_t = Tuns32;
     Tptrdiff_t = Tint32;
+    PTRSIZE = 4;
     }
 
     // set real size and padding
--- a/gen/statements.cpp	Sun Jun 15 18:57:11 2008 +0200
+++ b/gen/statements.cpp	Mon Jun 16 16:01:19 2008 +0200
@@ -440,19 +440,26 @@
             targetLoopStatement = tmp->statement;
 
         // find the right break block and jump there
+        bool found = false;
         IRState::LoopScopeVec::reverse_iterator it;
         for(it = p->loopbbs.rbegin(); it != p->loopbbs.rend(); ++it) {
             if(it->s == targetLoopStatement) {
                 llvm::BranchInst::Create(it->end, p->scopebb());
-                return;
+                found = true;
+                break;
             }
         }
-        assert(0);
+        assert(found);
     }
     else {
         emit_finallyblocks(p, enclosingtryfinally, p->loopbbs.back().enclosingtryfinally);
         llvm::BranchInst::Create(p->loopbbs.back().end, p->scopebb());
     }
+
+    // the break terminated this basicblock, start a new one
+    llvm::BasicBlock* oldend = gIR->scopeend();
+    llvm::BasicBlock* bb = llvm::BasicBlock::Create("afterbreak", p->topfunc(), oldend);
+    p->scope() = IRScope(bb,oldend);
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -724,7 +731,7 @@
         const LLType* elemTy = DtoType(condition->type);
         const llvm::ArrayType* arrTy = llvm::ArrayType::get(elemTy, inits.size());
         LLConstant* arrInit = llvm::ConstantArray::get(arrTy, inits);
-        llvm::GlobalVariable* arr = new llvm::GlobalVariable(arrTy, true, llvm::GlobalValue::InternalLinkage, arrInit, "string_switch_table_data", gIR->module);
+        llvm::GlobalVariable* arr = new llvm::GlobalVariable(arrTy, true, llvm::GlobalValue::InternalLinkage, arrInit, ".string_switch_table_data", gIR->module);
 
         const LLType* elemPtrTy = getPtrToType(elemTy);
         LLConstant* arrPtr = llvm::ConstantExpr::getBitCast(arr, elemPtrTy);
@@ -739,7 +746,7 @@
         sinits.push_back(arrPtr);
         LLConstant* sInit = llvm::ConstantStruct::get(sTy, sinits);
 
-        switchTable = new llvm::GlobalVariable(sTy, true, llvm::GlobalValue::InternalLinkage, sInit, "string_switch_table", gIR->module);
+        switchTable = new llvm::GlobalVariable(sTy, true, llvm::GlobalValue::InternalLinkage, sInit, ".string_switch_table", gIR->module);
     }
 
     // body block
--- a/tango/lib/compiler/llvmdc/memory.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/tango/lib/compiler/llvmdc/memory.d	Mon Jun 16 16:01:19 2008 +0200
@@ -47,7 +47,6 @@
         {
                 void* llvm_frameaddress(uint level=0);
         }
-        extern(C) int printf(char*, ...);
     }
 }
 
@@ -98,7 +97,11 @@
  */
 extern (C) void* rt_stackTop()
 {
-    version( D_InlineAsm_X86 )
+    version(LLVMDC)
+    {
+        return llvm_frameaddress();
+    }
+    else version( D_InlineAsm_X86 )
     {
         asm
         {
@@ -107,10 +110,6 @@
             ret;
         }
     }
-    else version(LLVMDC)
-    {
-        return llvm_frameaddress();
-    }
     else
     {
             static assert( false, "Architecture not supported." );
--- a/tango/lib/compiler/llvmdc/qsort2.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/tango/lib/compiler/llvmdc/qsort2.d	Mon Jun 16 16:01:19 2008 +0200
@@ -30,14 +30,14 @@
     return tiglobal.compare(p1, p2);
 }
 
-extern (C) long _adSort(Array a, TypeInfo ti)
+extern (C) Array _adSort(Array a, TypeInfo ti)
 {
     synchronized
     {
         tiglobal = ti;
         tango.stdc.stdlib.qsort(a.ptr, a.length, cast(size_t)ti.tsize(), &cmp);
     }
-    return *cast(long*)(&a);
+    return a;
 }
 
 
--- a/test/a.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/a.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module a;
 
+extern(C) int printf(char*, ...);
+
 int i = 42;
 
 void main()
--- a/test/aa3.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/aa3.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,8 @@
 module aa3;
 
+extern(C) int printf(char*, ...);
+alias char[] string;
+
 void main()
 {
     int[string] aa;
--- a/test/aa6.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/aa6.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module aa6;
 
+extern(C) int printf(char*, ...);
+
 void main()
 {
     int[int] aa;
--- a/test/alloca1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/alloca1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -3,6 +3,8 @@
 pragma(LLVM_internal, "alloca")
 void* alloca(uint);
 
+extern(C) int printf(char*, ...);
+
 void main()
 {
     int n = 16;
--- a/test/b.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/b.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module b;
 
+extern(C) int printf(char*, ...);
+
 struct S
 {
     int i;
--- a/test/bitops.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bitops.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,6 @@
+
+extern(C) int printf(char*, ...);
+
 void main()
 {
     printf("Bitwise operations test\n");
--- a/test/bug10.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug10.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,6 @@
 module bug10;
-import std.stdio;
+extern(C) int printf(char*, ...);
+
 class C
 {
     char[] msg;
--- a/test/bug12.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug12.d	Mon Jun 16 16:01:19 2008 +0200
@@ -2,5 +2,5 @@
 
 void main()
 {
-    const string name="y";
+    const char[] name="y";
 }
--- a/test/bug20.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug20.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug20;
+extern(C) int printf(char*, ...);
 
 void func(void delegate() dg)
 {
--- a/test/bug21.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug21.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug21;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug22.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug22.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug22;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug23.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug23.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,6 @@
 module bug23;
+extern(C) int printf(char*, ...);
+
 void main()
 {
     int i;
--- a/test/bug24.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug24.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug24;
+extern(C) int printf(char*, ...);
 
 struct S
 {
--- a/test/bug25.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug25.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug25;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug29.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug29.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug29;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug32.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug32.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug32;
+extern(C) int printf(char*, ...);
 
 struct S
 {
--- a/test/bug50.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug50.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug50;
+extern(C) int printf(char*, ...);
 
 pragma(LLVM_internal, "notypeinfo")
 struct S
--- a/test/bug55.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug55.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug55;
+extern(C) int printf(char*, ...);
 
 int atoi(char[] s) {
     int i, fac=1;
--- a/test/bug60.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug60.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,6 @@
 module bug60;
+extern(C) int printf(char*, ...);
+
 void func(T...)(T t)
 {
     foreach(v;t) {
--- a/test/bug61.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug61.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug61;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug62.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug62.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug62;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug63.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug63.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug63;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug77.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug77.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module bug77;
-import std.c.string;
+import tango.stdc.string;
 void main()
 {
     size_t len;
--- a/test/bug80.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug80.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module bug80;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/bug9.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/bug9.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,6 @@
 module bug9;
+extern(C) int printf(char*, ...);
+
 struct rgb
 {
   ubyte[3] values;
--- a/test/calls1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/calls1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module calls1;
-import std.stdarg;
+import tango.core.Vararg;
 void main()
 {
     {int a = byVal1(3);}
--- a/test/classes.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/classes.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 class C
 {
     int i;
--- a/test/classes11.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/classes11.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module classes11;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/classes2.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/classes2.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 class A
 {
     int i;
--- a/test/classes4.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/classes4.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 class A
 {
     int i = 42;
--- a/test/classes5.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/classes5.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module classes5;
+extern(C) int printf(char*, ...);
 
 struct S
 {
--- a/test/classes6.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/classes6.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module classes6;
+extern(C) int printf(char*, ...);
 
 class C
 {
--- a/test/classinfo1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/classinfo1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module classinfo1;
 
+extern(C) int printf(char*, ...);
+
 class NoPtrs
 {
 }
--- a/test/cond.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/cond.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 version=AndAnd;
 version=OrOr;
 
--- a/test/dgs.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/dgs.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,6 @@
+
+extern(C) int printf(char*, ...);
+
 struct S
 {
     int i;
--- a/test/dotproduct.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/dotproduct.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 struct vec3
 {
     float x,y,z;
--- a/test/e.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/e.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module e;
 
+extern(C) int printf(char*, ...);
+
 struct C
 {
     float x=0,y=0;
--- a/test/floatcmp.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/floatcmp.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module floatcmp;
+extern(C) int printf(char*, ...);
 
 void eq()
 {
--- a/test/foreach1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/foreach1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,17 +1,17 @@
 module foreach1;
-import std.stdio;
+extern(C) int printf(char*, ...);
 
 void main()
 {
     static arr = [1,2,3,4,5];
 
-    writef("forward");
+    printf("forward");
     foreach(v;arr) {
-        writef(' ',v);
+        printf(" %d",v);
     }
-    writef("\nreverse");
+    printf("\nreverse");
     foreach_reverse(v;arr) {
-        writef(' ',v);
+        printf(" %d",v);
     }
-    writef("\n");
+    printf("\n");
 }
--- a/test/foreach2.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/foreach2.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module foreach2;
-
+extern(C) int printf(char*, ...);
 void main()
 {
     static arr = [1.0, 2.0, 4.0, 8.0, 16.0];
--- a/test/foreach3.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/foreach3.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module foreach3;
-
+extern(C) int printf(char*, ...);
 void main()
 {
     static str = ['h','e','l','l','o'];
--- a/test/foreach4.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/foreach4.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module foreach4;
-
+extern(C) int printf(char*, ...);
 void main()
 {
     int[] arr = new int[4];
--- a/test/foreach5.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/foreach5.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module foreach5;
-
+extern(C) int printf(char*, ...);
 void main()
 {
     int[3] arr = [1,2,3];
--- a/test/funcptr.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/funcptr.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 int return_six()
 {
     return 6;
--- a/test/funcs.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/funcs.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 void main()
 {
     printf("Testing functions\n");
--- a/test/g.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/g.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module g;
 
+extern(C) int printf(char*, ...);
+
 void func(char[] str)
 {
     printf("%.*s\n", str.length, str.ptr);
--- a/test/globals1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/globals1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module globals1;
+extern(C) int printf(char*, ...);
 
 char[] gstr = "hello world";
 
--- a/test/innerclass1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/innerclass1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module innerclass1;
+extern(C) int printf(char*, ...);
 
 class Outer
 {
--- a/test/mainargs1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/mainargs1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -2,7 +2,7 @@
 
 extern(C) int printf(char*,...);
 
-void main(string[] args)
+void main(char[][] args)
 {
     foreach(v; args)
     {
--- a/test/moduleinfo1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/moduleinfo1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,8 +1,5 @@
 module moduleinfo1;
 
-// has static this
-import std.outofmemory;
-
 static this()
 {
 }
--- a/test/moduleinfo2.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/moduleinfo2.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,12 +1,14 @@
 module moduleinfo2;
-import std.stdio;
+
+extern(C) int printf(char*, ...);
+
 void main()
 {
     ModuleInfo[] mi = ModuleInfo.modules();
-    writefln("listing ",mi.length," modules");
+    printf("listing %u modules:\n");
     foreach(m; mi)
     {
-        writefln("  ",m.name);
+        printf("  %s\n", m.name.length, m.name.ptr);
     }
     assert(mi.length > 50);
 }
--- a/test/multiarr4.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/multiarr4.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module multiarr4;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/nested5.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/nested5.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module nested5;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/nested6.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/nested6.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module nested6;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/nested7.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/nested7.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module nested7;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/nested8.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/nested8.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module nested8;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/nested9.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/nested9.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module nested9;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/pt.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/pt.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,6 @@
+
+extern(C) int printf(char*, ...);
+
 int main()
 {
     char[16] s = void;
--- a/test/ptrarith.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/ptrarith.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 void main()
 {
     printf("Pointer arithmetic test\n");
--- a/test/scope1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/scope1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module scope1;
-
+extern(C) int printf(char*, ...);
 void main()
 {
     printf("1\n");
--- a/test/scope2.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/scope2.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module scope2;
-
+extern(C) int printf(char*, ...);
 void main()
 {
     scope(exit) printf("exit\n");
--- a/test/scope3.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/scope3.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module scope3;
-
+extern(C) int printf(char*, ...);
 void main()
 {
     int i;
--- a/test/sieve.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/sieve.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 /* Eratosthenes Sieve prime number calculation. */
 
+extern(C) int printf(char*, ...);
+
 bool flags[8191];
 
 int main()
--- a/test/sqrts.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/sqrts.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,6 +1,6 @@
 module sqrts;
 
-import std.c.math;
+import tango.stdc.math;
 
 double sqrt(double d)
 {
--- a/test/static_ctor.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/static_ctor.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 static this()
 {
     printf("static this\n");
--- a/test/staticarrays.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/staticarrays.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 void numbers()
 {
     bool[8] bools;
--- a/test/strings1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/strings1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module strings1;
-
+extern(C) int printf(char*, ...);
 void f(char[11] buffer)
 {
     printf("%.*s\n", buffer.length, buffer.ptr);
--- a/test/switch2.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/switch2.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module switch2;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/switch3.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/switch3.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module switch3;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/typeinfo.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/typeinfo.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,4 +1,5 @@
 module typeinfo;
+extern(C) int printf(char*, ...);
 
 void main()
 {
--- a/test/typeinfo7.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/typeinfo7.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module typeinfo7;
-
+extern(C) int printf(char*, ...);
 int func(long)
 {
     return 0;
--- a/test/typeinfo8.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/typeinfo8.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module typeinfo8;
-
+extern(C) int printf(char*, ...);
 struct S
 {
     void func()
--- a/test/unrolled.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/unrolled.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module unrolled;
 
+extern(C) int printf(char*, ...);
+
 void test(T...)(T t) {
     foreach (value; t) {
         printf("%d\n", value);
--- a/test/v2d.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/v2d.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,3 +1,5 @@
+extern(C) int printf(char*, ...);
+
 struct V2D(T)
 {
     T x,y;
--- a/test/vararg1.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/vararg1.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,6 +1,6 @@
 module vararg1;
 
-import std.c.stdarg;
+import tango.stdc.stdarg;
 
 extern(C) int add(int n, ...)
 {
--- a/test/vararg3.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/vararg3.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,6 +1,6 @@
 module vararg3;
 
-import std.stdarg;
+import tango.core.Vararg;
 
 void func(...)
 {
--- a/test/vararg4.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/vararg4.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module vararg4;
-import std.stdarg;
+import tango.core.Vararg;
 
 void vafunc(...)
 {
--- a/test/vararg5.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/vararg5.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,5 @@
 module vararg5;
-import std.stdarg;
+import tango.core.Vararg;
 void func(...)
 {
     char[] str = va_arg!(char[])(_argptr);
--- a/test/virtcall.d	Sun Jun 15 18:57:11 2008 +0200
+++ b/test/virtcall.d	Mon Jun 16 16:01:19 2008 +0200
@@ -1,5 +1,7 @@
 module virtcall;
 
+extern(C) int printf(char*, ...);
+
 class C
 {
     override char[] toString()