From 035e9664c7d9894e77b2b38781057faf4be06c20 Mon Sep 17 00:00:00 2001 From: Rainer Schuetze Date: Tue, 17 Feb 2015 08:29:47 +0100 Subject: add some test cases for argument ordering --- test/cvtest.d | 21 ++++++++++++++++----- test/test.visualdproj | 12 +++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/test/cvtest.d b/test/cvtest.d index 1b1e587..f99e3e0 100644 --- a/test/cvtest.d +++ b/test/cvtest.d @@ -258,6 +258,15 @@ int args(int a, int b, int c, int abc) return d + e + abc; } +extern(C) int cargs(int a, int b, int c, int abc) +{ + int d = a + b; + int e = b + c; + foreach(x; global_oem_int_assoc_array) + e += x; + return d + e + abc; +} + size_t arrays() { int[] iarr; @@ -301,7 +310,7 @@ Action convertEnum() return Accept; } -int main2(char[][]argv) +int main2(string[]argv) { convertEnum(); @@ -367,12 +376,13 @@ int main2(char[][]argv) } -int main(char[][]argv) +int main(string[]argv) { long lng = 3; ulong ulng = 4; args(3, 4, 5, 345); + cargs(3, 4, 5, 345); voidpointers(null); arrays(); lexical_scope(); @@ -387,6 +397,7 @@ int main(char[][]argv) main2(argv); writefln("Hello world"); + getchar(); int[int] int_arr; int_arr[1] = 100; @@ -473,9 +484,9 @@ int strings() const(wchar)[] cws = ws; const(dchar)[] cds = ds; - immutable char[] i2cs = cs; - immutable wchar[] i2ws = ws; - immutable dchar[] i2ds = ds; + immutable char[] i2cs = cs[0..$-1]; + immutable wchar[] i2ws = ws[0..$-1]; + immutable dchar[] i2ds = ds[0..$-1]; const char[] c2cs = cs; const wchar[] c2ws = ws; diff --git a/test/test.visualdproj b/test/test.visualdproj index 367e6bf..128ca95 100644 --- a/test/test.visualdproj +++ b/test/test.visualdproj @@ -8,6 +8,7 @@ 0 0 0 + 0 0 0 0 @@ -108,6 +109,7 @@ 0 0 0 + 0 0 0 0 @@ -208,6 +210,7 @@ 0 0 0 + 0 0 0 0 @@ -308,6 +311,7 @@ 0 0 0 + 0 0 0 0 @@ -343,7 +347,7 @@ 0 0 0 - 2.043 + 2 0 0 0 @@ -408,6 +412,7 @@ 0 0 0 + 0 0 0 0 @@ -508,6 +513,7 @@ 0 0 0 + 0 0 0 0 @@ -608,6 +614,7 @@ 0 0 0 + 0 0 0 0 @@ -708,6 +715,7 @@ 0 0 0 + 0 0 0 0 @@ -808,6 +816,7 @@ 0 0 0 + 0 0 0 0 @@ -908,6 +917,7 @@ 0 0 0 + 0 0 0 0 -- cgit v0.12