tw15777b.pp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. { %opt=-vw -Sew }
  2. { %fail }
  3. { has to fail because of the longint/single mixing with the procvars }
  4. {$mode macpas}
  5. program testunivprocparams;
  6. type
  7. Int8 = -128..127;
  8. Int16 = integer;
  9. Int32 = longint;
  10. Rec32 = packed record f1, f2: Int16 end;
  11. procedure calli32value( procedure pp( i: univ Int32; x: string); i: univ Int32; x: string);
  12. begin
  13. pp( i, x)
  14. end;
  15. procedure calli32var( procedure pp( var i: univ Int32; x: string); i: univ Int32; x: string);
  16. begin
  17. pp( i, x)
  18. end;
  19. procedure calli32const( procedure pp( const i: univ Int32; x: string); i: univ Int32; x: string);
  20. begin
  21. pp( i, x)
  22. end;
  23. procedure psvalue( s: single; x: string);
  24. begin
  25. writeln( s, ', ', x)
  26. end;
  27. procedure psvar( var s: single; x: string);
  28. begin
  29. writeln( s, ', ', x)
  30. end;
  31. procedure psconst( const s: single; x: string);
  32. begin
  33. writeln( s, ', ', x)
  34. end;
  35. procedure pdvalue( d: double; x: string);
  36. begin
  37. writeln( d, ', ', x)
  38. end;
  39. procedure pdvar( var d: double; x: string);
  40. begin
  41. writeln( d, ', ', x)
  42. end;
  43. procedure pdconst( const d: double; x: string);
  44. begin
  45. writeln( d, ', ', x)
  46. end;
  47. procedure pi8value( i8: Int8; x: string);
  48. begin
  49. writeln( i8, ', ', x)
  50. end;
  51. procedure pi8var( var i8: Int8; x: string);
  52. begin
  53. writeln( i8, ', ', x)
  54. end;
  55. procedure pi8const( const i8: Int8; x: string);
  56. begin
  57. writeln( i8, ', ', x)
  58. end;
  59. procedure pi16value( i16: Int16; x: string);
  60. begin
  61. writeln( i16, ', ', x)
  62. end;
  63. procedure pi16var( var i16: Int16; x: string);
  64. begin
  65. writeln( i16, ', ', x)
  66. end;
  67. procedure pi16const( const i16: Int16; x: string);
  68. begin
  69. writeln( i16, ', ', x)
  70. end;
  71. procedure pi32value( i32: Int32; x: string);
  72. begin
  73. writeln( i32, ', ', x)
  74. end;
  75. procedure pi32var( var i32: Int32; x: string);
  76. begin
  77. writeln( i32, ', ', x)
  78. end;
  79. procedure pi32const( const i32: Int32; x: string);
  80. begin
  81. writeln( i32, ', ', x)
  82. end;
  83. procedure variouscalli32;
  84. var
  85. s: single;
  86. d: double;
  87. i8: Int8;
  88. i16: Int16;
  89. i32: Int32;
  90. r: Rec32;
  91. begin
  92. s:=1.0;
  93. d:=1.0;
  94. i8:=1;
  95. i16:=2;
  96. r.f1:=3;
  97. r.f1:=4;
  98. i32:=5;
  99. calli32value( psvalue, s, 'psvalue');
  100. calli32var( psvar, s, 'psvar');
  101. calli32const( psconst, s, 'psconst');
  102. end;
  103. begin
  104. variouscalli32
  105. end.