Răsfoiți Sursa

* New DLL overloading tests

git-svn-id: trunk@17812 -
pierre 14 ani în urmă
părinte
comite
a0f7356edc

+ 4 - 0
.gitattributes

@@ -9642,6 +9642,10 @@ tests/test/library/tlib1a.pp svneol=native#text/plain
 tests/test/library/tlib1a2.pp svneol=native#text/plain
 tests/test/library/tlib1b.pp svneol=native#text/plain
 tests/test/library/tlib2b.pp svneol=native#text/plain
+tests/test/library/tlib3a.pp svneol=native#text/plain
+tests/test/library/tlib3b.pp svneol=native#text/plain
+tests/test/library/tlib3c.pp svneol=native#text/plain
+tests/test/library/tlib3d.pp svneol=native#text/plain
 tests/test/library/ttdllexe.pp svneol=native#text/plain
 tests/test/library/ttdlltest.pp svneol=native#text/plain
 tests/test/library/ulib2a.pp svneol=native#text/plain

+ 15 - 0
tests/test/library/tlib3a.pp

@@ -0,0 +1,15 @@
+{ %needlibrary }
+{ %norun }
+{ %neededafter }
+
+library tlib3a;
+
+  procedure p(var a : dword);
+    begin
+      a:=1;
+    end;
+
+  exports p;
+
+begin
+end.

+ 15 - 0
tests/test/library/tlib3b.pp

@@ -0,0 +1,15 @@
+{ %needlibrary }
+{ %norun }
+{ %neededafter }
+
+library tlib3b;
+
+  function p(a1, a2, a3, a4, a5, a6, a7 : dword) : dword;
+    begin
+      p:=a1+a2+a3+a4+a5+a6+a7;
+    end;
+
+  exports p;
+
+begin
+end.

+ 30 - 0
tests/test/library/tlib3c.pp

@@ -0,0 +1,30 @@
+{ %skiptarget=win32,win64 }
+{ %needlibrary }
+{ %fail }
+{ %opt=-vw -Sew }
+{ %neededafter }
+
+program tlib3b;
+
+  procedure p_proc(var a : dword); external 'tlib3a' name 'p';
+
+  function p(a1, a2, a3, a4, a5, a6, a7 : dword) : dword; external 'tlib3b' name 'p';
+
+  var
+    a : dword;
+begin
+  a:=0;
+  p_proc(a);
+  if a<>1 then
+    begin
+      Writeln('Error calling tlib3a p procedure');
+      halt(1);
+    end;
+  a:=p(0,1,0,1,0,10,0);
+  if a<>12 then
+    begin
+      Writeln('Error calling tlib3b p function');
+      halt(1);
+    end;
+  Writeln('Everything works OK');
+end.

+ 31 - 0
tests/test/library/tlib3d.pp

@@ -0,0 +1,31 @@
+{ %target=win32,win64 }
+{ %needlibrary }
+{ %opt=-vw -Sew }
+{ %neededafter }
+
+{ On targets that support dll overloading, no
+  warning should be generated, and the resulting code sholud work correctly. }
+program tlib3b;
+
+  procedure p_proc(var a : dword); external 'tlib3a' name 'p';
+
+  function p(a1, a2, a3, a4, a5, a6, a7 : dword) : dword; external 'tlib3b' name 'p';
+
+  var
+    a : dword;
+begin
+  a:=0;
+  p_proc(a);
+  if a<>1 then
+    begin
+      Writeln('Error calling tlib3a p procedure');
+      halt(1);
+    end;
+  a:=p(0,1,0,1,0,10,0);
+  if a<>12 then
+    begin
+      Writeln('Error calling tlib3b p function');
+      halt(1);
+    end;
+  Writeln('Everything works OK');
+end.