diff --git a/lib/llvmdcore.bc b/lib/llvmdcore.bc index 4a69a882..af91b154 100644 Binary files a/lib/llvmdcore.bc and b/lib/llvmdcore.bc differ diff --git a/lib/lphobos.bc b/lib/lphobos.bc new file mode 100644 index 00000000..90e9956d Binary files /dev/null and b/lib/lphobos.bc differ diff --git a/lphobos/build.sh b/lphobos/build.sh index 4ee5636b..6437ce24 100755 --- a/lphobos/build.sh +++ b/lphobos/build.sh @@ -6,6 +6,7 @@ else dc_cmd="llvmdc" fi +# build runtime $dc_cmd internal/contract.d \ internal/arrays.d \ internal/moduleinit.d \ @@ -19,6 +20,10 @@ llvm-link -f -o=obj/all.bc obj/contract.bc obj/arrays.bc obj/moduleinit.bc obj/o opt -f -std-compile-opts -o=../lib/llvmdcore.bc obj/all.bc || exit 1 +# build phobos +$dc_cmd std/stdio.d -c -odobj || exit 1 +llvm-link -f -o=../lib/lphobos.bc obj/stdio.bc || exit 1 + if [ "$1" = "ll" ]; then llvm-dis -f -o=all.ll ../lib/llvmdcore.bc || exit 1 fi diff --git a/test/imports2.d b/test/imports2.d new file mode 100644 index 00000000..678a5ded --- /dev/null +++ b/test/imports2.d @@ -0,0 +1,6 @@ +module test; +import std.stdio; + +void main() { + writefln("Hello world!"[]); +} diff --git a/tester.sh b/tester.sh index b1582f77..876eb964 100755 --- a/tester.sh +++ b/tester.sh @@ -17,7 +17,7 @@ elif [ "$2" = "llopt" ]; then cat $1.ll exit $? elif [ "$2" = "run" ]; then - llvmdc $1 -Itest -odtest -of$1 && + llvmdc $1 lib/lphobos.bc -Itest -odtest -of$1 && $1 exit $? elif [ "$2" = "c" ]; then