diff --git a/tangotests/p.d b/tangotests/p.d new file mode 100644 index 00000000..a1206fc3 --- /dev/null +++ b/tangotests/p.d @@ -0,0 +1,18 @@ +extern(C) int printf(char*, ...); + +int main(char[][] args) +{ + printf("getint\n"); + int i = getint(); + printf("assert true\n"); + assert(i == 1234); + printf("assert false\n"); + assert(i != 1234); + printf("return\n"); + return 0; +} + +int getint() +{ + return 1234; +} diff --git a/tangotests/q.d b/tangotests/q.d new file mode 100644 index 00000000..1365ab6d --- /dev/null +++ b/tangotests/q.d @@ -0,0 +1,22 @@ +class E : Exception +{ + this(char[] msg) + { + super(msg); + } + + char[] toString() + { + return super.toString(); + } +} + +extern(C) int printf(char*, ...); + +void main() +{ + auto e = new E("hello world"); + auto msg = e.toString(); + printf("message should be: '%.*s'\n", msg.length, msg.ptr); + throw e; +} diff --git a/tangotests/r.d b/tangotests/r.d new file mode 100644 index 00000000..b36cec7a --- /dev/null +++ b/tangotests/r.d @@ -0,0 +1,27 @@ +extern(C) int printf(char*, ...); + +class C +{ + void dump() + { + printf("C dumped\n"); + } +} + +void heap() +{ + auto c = new C; + c.dump(); +} + +void stack() +{ + scope c = new C; + c.dump(); +} + +void main() +{ + heap(); + stack(); +}