Browse Source

+ added testing for cdecl and array of const. (should not compile)

carl 23 years ago
parent
commit
c3540440c3
2 changed files with 47 additions and 0 deletions
  1. 26 0
      tests/tbf/tb0139.pp
  2. 21 0
      tests/tbf/tb0140.pp

+ 26 - 0
tests/tbf/tb0139.pp

@@ -0,0 +1,26 @@
+{%fail}
+{
+  This program should fail compilation since the high() 
+  parameter cannot be used in a cdecl'ed function using
+  array of const, it uses the exact calling conventions
+  as a C compiler, and the length is not passed!
+}
+
+  procedure proc_const_smallarray_const_2(const arr : array of const);cdecl;
+  var
+   i: integer;
+  begin
+     if high(arr)<0 then
+       WriteLn('hello world!');
+  end;
+
+
+Begin
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-11-09 21:57:57  carl
+    + added testing for cdecl and array of const. (should not compile)
+
+}

+ 21 - 0
tests/tbf/tb0140.pp

@@ -0,0 +1,21 @@
+{%fail}
+{
+  This program should fail compilation since array of const
+  with cdecl modifier can only be used on last parameter of
+  routine
+}
+
+  procedure proc_const_smallarray_const_2(const arr : array of const; b: byte);cdecl;
+  begin
+  end;
+
+
+Begin
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-11-09 21:57:57  carl
+    + added testing for cdecl and array of const. (should not compile)
+
+}