tcalvar1.pp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. {****************************************************************}
  2. { CODE GENERATOR TEST PROGRAM }
  3. { By Carl Eric Codere }
  4. {****************************************************************}
  5. { NODE TESTED : secondcallparan() }
  6. {****************************************************************}
  7. { PRE-REQUISITES: secondload() }
  8. { secondassign() }
  9. { secondtypeconv() }
  10. { secondtryexcept() }
  11. { secondcalln() }
  12. { secondadd() }
  13. {****************************************************************}
  14. { DEFINES: }
  15. { FPC = Target is FreePascal compiler }
  16. {****************************************************************}
  17. { REMARKS: This tests a subset of the secondcalln() node }
  18. { (var parameters with standard calling convention) }
  19. {****************************************************************}
  20. program tcalvar1;
  21. {$mode objfpc}
  22. {$INLINE ON}
  23. {$R+}
  24. {$P-}
  25. {$V+}
  26. {$ifdef VER70}
  27. {$define tp}
  28. {$endif}
  29. { REAL should map to single or double }
  30. { so it is not checked, since single }
  31. { double nodes are checked. }
  32. { assumes that enumdef is the same as orddef (same storage format) }
  33. const
  34. { should be defined depending on CPU target }
  35. {$ifdef fpc}
  36. {$ifdef cpu68k}
  37. BIG_INDEX = 8000;
  38. SMALL_INDEX = 13;
  39. {$endif}
  40. {$ifdef cpui386}
  41. BIG_INDEX = 33000;
  42. SMALL_INDEX = 13; { value should not be aligned! }
  43. {$endif}
  44. {$else}
  45. BIG_INDEX = 33000;
  46. SMALL_INDEX = 13; { value should not be aligned! }
  47. {$endif}
  48. RESULT_U8BIT = $55;
  49. RESULT_U16BIT = $500F;
  50. RESULT_S32BIT = $500F0000;
  51. RESULT_S64BIT = $500F0000;
  52. RESULT_S32REAL = 1777.12;
  53. RESULT_S64REAL = 3444.24;
  54. RESULT_BOOL8BIT = 1;
  55. RESULT_BOOL16BIT = 1;
  56. RESULT_BOOL32BIT = 1;
  57. RESULT_PCHAR = 'Hello world';
  58. RESULT_BIGSTRING = 'Hello world';
  59. RESULT_SMALLSTRING = 'H';
  60. RESULT_CHAR = 'I';
  61. RESULT_BOOLEAN = TRUE;
  62. type
  63. tclass1 = class
  64. end;
  65. tprocedure = procedure;
  66. tsmallrecord = packed record
  67. b: byte;
  68. w: word;
  69. end;
  70. tlargerecord = packed record
  71. b: array[1..BIG_INDEX] of byte;
  72. end;
  73. tsmallarray = packed array[1..SMALL_INDEX] of byte;
  74. tsmallsetenum =
  75. (A_A,A_B,A_C,A_D);
  76. tsmallset = set of tsmallsetenum;
  77. tlargeset = set of char;
  78. tsmallstring = string[2];
  79. var
  80. global_u8bit : byte;
  81. global_u16bit : word;
  82. global_s32bit : longint;
  83. global_s64bit : int64;
  84. global_s32real : single;
  85. global_s64real : double;
  86. global_ptr : pchar;
  87. global_proc : tprocedure;
  88. global_class : tclass1;
  89. global_bigstring : shortstring;
  90. global_boolean : boolean;
  91. global_char : char;
  92. value_u8bit : byte;
  93. value_u16bit : word;
  94. value_s32bit : longint;
  95. value_s64bit : int64;
  96. value_s32real : single;
  97. value_s64real : double;
  98. value_proc : tprocedure;
  99. value_ptr : pchar;
  100. value_class : tclass1;
  101. value_smallrec : tsmallrecord;
  102. value_largerec : tlargerecord;
  103. value_smallset : tsmallset;
  104. value_smallstring : tsmallstring;
  105. value_bigstring : shortstring;
  106. value_largeset : tlargeset;
  107. value_smallarray : tsmallarray;
  108. value_boolean : boolean;
  109. value_char : char;
  110. procedure fail;
  111. begin
  112. WriteLn('Failure.');
  113. halt(1);
  114. end;
  115. procedure clear_globals;
  116. begin
  117. global_u8bit := 0;
  118. global_u16bit := 0;
  119. global_s32bit := 0;
  120. global_s64bit := 0;
  121. global_s32real := 0.0;
  122. global_s64real := 0.0;
  123. global_ptr := nil;
  124. global_proc := nil;
  125. global_class := nil;
  126. global_bigstring := '';
  127. global_boolean := false;
  128. global_char := #0;
  129. end;
  130. procedure clear_values;
  131. begin
  132. value_u8bit := 0;
  133. value_u16bit := 0;
  134. value_s32bit := 0;
  135. value_s64bit := 0;
  136. value_s32real := 0.0;
  137. value_s64real := 0.0;
  138. value_proc := nil;
  139. value_ptr := nil;
  140. value_class := nil;
  141. fillchar(value_smallrec, sizeof(value_smallrec), #0);
  142. fillchar(value_largerec, sizeof(value_largerec), #0);
  143. value_smallset := [];
  144. value_smallstring := '';
  145. value_bigstring := '';
  146. value_largeset := [];
  147. fillchar(value_smallarray, sizeof(value_smallarray), #0);
  148. value_boolean := false;
  149. value_char:=#0;
  150. end;
  151. procedure testprocedure;
  152. begin
  153. end;
  154. function getu8bit : byte;
  155. begin
  156. getu8bit:=RESULT_U8BIT;
  157. end;
  158. function getu16bit: word;
  159. begin
  160. getu16bit:=RESULT_U16BIT;
  161. end;
  162. function gets32bit: longint;
  163. begin
  164. gets32bit:=RESULT_S32BIT;
  165. end;
  166. function gets64bit: int64;
  167. begin
  168. gets64bit:=RESULT_S64BIT;
  169. end;
  170. function gets32real: single;
  171. begin
  172. gets32real:=RESULT_S32REAL;
  173. end;
  174. function gets64real: double;
  175. begin
  176. gets64real:=RESULT_S64REAL;
  177. end;
  178. {************************************************************************}
  179. { VAR PARAMETERS }
  180. {************************************************************************}
  181. procedure proc_var_s32bit(var v : longint);
  182. begin
  183. v:=RESULT_S32BIT;
  184. end;
  185. procedure proc_var_s64bit(var v: int64);
  186. begin
  187. v:=RESULT_S64BIT;
  188. end;
  189. procedure proc_var_u8bit(var v: byte);
  190. begin
  191. v:=RESULT_U8BIT;
  192. end;
  193. procedure proc_var_smallrecord(var smallrec : tsmallrecord);
  194. begin
  195. smallrec.b := RESULT_U8BIT;
  196. smallrec.w := RESULT_U16BIT;
  197. end;
  198. procedure proc_var_largerecord(var largerec : tlargerecord);
  199. begin
  200. largerec.b[1] := RESULT_U8BIT;
  201. largerec.b[2] := RESULT_U8BIT;
  202. end;
  203. procedure proc_var_smallset(var smallset : tsmallset);
  204. begin
  205. smallset := [A_A,A_D];
  206. end;
  207. procedure proc_var_largeset(var largeset : tlargeset);
  208. begin
  209. largeset:= largeset + ['I'];
  210. end;
  211. procedure proc_var_smallstring(var s:tsmallstring);
  212. begin
  213. s:=RESULT_SMALLSTRING;
  214. end;
  215. procedure proc_var_bigstring(var s:shortstring);
  216. begin
  217. s:=RESULT_BIGSTRING;
  218. end;
  219. procedure proc_var_openstring(var s: OpenString);
  220. begin
  221. global_u8bit := high(s);
  222. s:=RESULT_SMALLSTRING;
  223. end;
  224. procedure proc_var_smallarray(var arr : tsmallarray);
  225. begin
  226. arr[SMALL_INDEX] := RESULT_U8BIT;
  227. arr[1] := RESULT_U8BIT;
  228. end;
  229. procedure proc_var_smallarray_open(var arr : array of byte);
  230. begin
  231. arr[high(arr)] := RESULT_U8BIT;
  232. arr[low(arr)] := RESULT_U8BIT;
  233. end;
  234. procedure proc_var_smallarray_const_1(var arr : array of const);
  235. var
  236. i: integer;
  237. begin
  238. for i:=0 to high(arr) do
  239. begin
  240. case arr[i].vtype of
  241. vtInteger : arr[i].vinteger := RESULT_U8BIT;
  242. vtBoolean : arr[i].vboolean := RESULT_BOOLEAN;
  243. else
  244. RunError(255);
  245. end;
  246. end; {endfor}
  247. end;
  248. procedure proc_var_smallarray_const_2(var arr : array of const);
  249. var
  250. i: integer;
  251. begin
  252. if high(arr)<0 then
  253. global_u8bit := RESULT_U8BIT;
  254. end;
  255. procedure proc_var_formaldef_array(var buf);
  256. var
  257. p: ^byte;
  258. begin
  259. { array is indexed from 1 }
  260. p := @buf;
  261. p[SMALL_INDEX-1] := RESULT_U8BIT;
  262. p[0] := RESULT_U8BIT;
  263. end;
  264. procedure proc_var_formaldef_string(var buf);
  265. var
  266. p: ^byte;
  267. begin
  268. { array is indexed from 1 }
  269. p := @buf;
  270. p[SMALL_INDEX-1] := RESULT_U8BIT;
  271. p[0] := RESULT_U8BIT;
  272. end;
  273. {************************************************************************}
  274. { MIXED VAR PARAMETERS }
  275. {************************************************************************}
  276. procedure proc_var_s32bit_mixed(b1 : byte;var v : longint; b2: byte);
  277. begin
  278. v:=RESULT_S32BIT;
  279. value_u8bit := RESULT_U8BIT;
  280. end;
  281. procedure proc_var_s64bit_mixed(b1 : byte;var v: int64; b2: byte);
  282. begin
  283. v:=RESULT_S64BIT;
  284. value_u8bit := RESULT_U8BIT;
  285. end;
  286. procedure proc_var_u8bit_mixed(b1 : byte;var v: byte; b2: byte);
  287. begin
  288. v:=RESULT_U8BIT;
  289. value_u8bit := RESULT_U8BIT;
  290. end;
  291. procedure proc_var_smallrecord_mixed(b1 : byte; var smallrec : tsmallrecord; b2: byte);
  292. begin
  293. smallrec.b := RESULT_U8BIT;
  294. smallrec.w := RESULT_U16BIT;
  295. value_u8bit := RESULT_U8BIT;
  296. end;
  297. procedure proc_var_largerecord_mixed(b1 : byte; var largerec : tlargerecord; b2: byte);
  298. begin
  299. largerec.b[1] := RESULT_U8BIT;
  300. largerec.b[2] := RESULT_U8BIT;
  301. value_u8bit := RESULT_U8BIT;
  302. end;
  303. procedure proc_var_smallset_mixed(b1 : byte; var smallset : tsmallset; b2: byte);
  304. begin
  305. smallset := [A_A,A_D];
  306. value_u8bit := RESULT_U8BIT;
  307. end;
  308. procedure proc_var_largeset_mixed(b1 : byte; var largeset : tlargeset; b2: byte);
  309. begin
  310. largeset:= largeset + ['I'];
  311. value_u8bit := RESULT_U8BIT;
  312. end;
  313. procedure proc_var_smallstring_mixed(b1 : byte; var s:tsmallstring; b2: byte);
  314. begin
  315. s:=RESULT_SMALLSTRING;
  316. value_u8bit := RESULT_U8BIT;
  317. end;
  318. procedure proc_var_bigstring_mixed(b1 : byte; var s:shortstring; b2: byte);
  319. begin
  320. s:=RESULT_BIGSTRING;
  321. value_u8bit := RESULT_U8BIT;
  322. end;
  323. procedure proc_var_openstring_mixed(b1 : byte; var s: OpenString; b2: byte);
  324. begin
  325. global_u8bit := high(s);
  326. s:=RESULT_SMALLSTRING;
  327. value_u8bit := RESULT_U8BIT;
  328. end;
  329. procedure proc_var_smallarray_mixed(b1 : byte; var arr : tsmallarray; b2: byte);
  330. begin
  331. arr[SMALL_INDEX] := RESULT_U8BIT;
  332. arr[1] := RESULT_U8BIT;
  333. value_u8bit := RESULT_U8BIT;
  334. end;
  335. procedure proc_var_smallarray_open_mixed(b1 : byte; var arr : array of byte; b2: byte);
  336. begin
  337. arr[high(arr)] := RESULT_U8BIT;
  338. arr[low(arr)] := RESULT_U8BIT;
  339. value_u8bit := RESULT_U8BIT;
  340. end;
  341. procedure proc_var_smallarray_const_1_mixed(b1 : byte; var arr : array of const; b2: byte);
  342. var
  343. i: integer;
  344. begin
  345. for i:=0 to high(arr) do
  346. begin
  347. case arr[i].vtype of
  348. vtInteger : arr[i].vinteger := RESULT_U8BIT;
  349. vtBoolean : arr[i].vboolean := RESULT_BOOLEAN;
  350. else
  351. RunError(255);
  352. end;
  353. end; {endfor}
  354. value_u8bit := RESULT_U8BIT;
  355. end;
  356. procedure proc_var_smallarray_const_2_mixed(b1 : byte; var arr : array of const; b2: byte);
  357. var
  358. i: integer;
  359. begin
  360. if high(arr)<0 then
  361. global_u8bit := RESULT_U8BIT;
  362. value_u8bit := RESULT_U8BIT;
  363. end;
  364. procedure proc_var_formaldef_array_mixed(b1 : byte; var buf; b2: byte);
  365. var
  366. p: ^byte;
  367. begin
  368. { array is indexed from 1 }
  369. p := @buf;
  370. p[SMALL_INDEX-1] := RESULT_U8BIT;
  371. p[0] := RESULT_U8BIT;
  372. value_u8bit := RESULT_U8BIT;
  373. end;
  374. procedure proc_var_formaldef_string_mixed(b1 : byte; var buf; b2: byte);
  375. var
  376. p: ^byte;
  377. begin
  378. { array is indexed from 1 }
  379. p := @buf;
  380. p[SMALL_INDEX-1] := RESULT_U8BIT;
  381. p[0] := RESULT_U8BIT;
  382. value_u8bit := RESULT_U8BIT;
  383. end;
  384. var
  385. failed: boolean;
  386. pp : ^pchar;
  387. begin
  388. {***************************** NORMAL TESTS *******************************}
  389. clear_globals;
  390. clear_values;
  391. failed:=false;
  392. write('Var parameter test (src : LOC_REFERENCE (orddef)))...');
  393. proc_var_s32bit(global_s32bit);
  394. if global_s32bit <> RESULT_S32BIT then
  395. failed:=true;
  396. clear_globals;
  397. clear_values;
  398. proc_var_s64bit(global_s64bit);
  399. if global_s64bit <> RESULT_S64BIT then
  400. failed:=true;
  401. clear_globals;
  402. clear_values;
  403. proc_var_u8bit(global_u8bit);
  404. if global_u8bit <> RESULT_U8BIT then
  405. failed:=true;
  406. if failed then
  407. fail
  408. else
  409. WriteLn('Passed!');
  410. write('Var parameter test (src : LOC_REFERENCE (recorddef)))...');
  411. clear_globals;
  412. clear_values;
  413. failed := false;
  414. proc_var_smallrecord(value_smallrec);
  415. if (value_smallrec.b <> RESULT_U8BIT) or (value_smallrec.w <> RESULT_U16BIT) then
  416. failed := true;
  417. clear_globals;
  418. clear_values;
  419. proc_var_largerecord(value_largerec);
  420. if (value_largerec.b[1] <> RESULT_U8BIT) or (value_largerec.b[2] <> RESULT_U8BIT) then
  421. failed := true;
  422. if failed then
  423. fail
  424. else
  425. WriteLn('Passed!');
  426. write('var parameter test (src : LOC_REFERENCE (setdef)))...');
  427. clear_globals;
  428. clear_values;
  429. failed := false;
  430. proc_var_smallset(value_smallset);
  431. if (not (A_A in value_smallset)) or (not (A_D in value_smallset)) then
  432. failed := true;
  433. clear_globals;
  434. clear_values;
  435. proc_var_largeset(value_largeset);
  436. if not ('I' in value_largeset) then
  437. failed := true;
  438. if failed then
  439. fail
  440. else
  441. WriteLn('Passed!');
  442. write('var parameter test (src : LOC_REFERENCE (stringdef)))...');
  443. clear_globals;
  444. clear_values;
  445. failed := false;
  446. proc_var_smallstring(value_smallstring);
  447. if value_smallstring <> RESULT_SMALLSTRING then
  448. failed := true;
  449. clear_globals;
  450. clear_values;
  451. proc_var_bigstring(value_bigstring);
  452. if value_bigstring <> RESULT_BIGSTRING then
  453. failed := true;
  454. clear_globals;
  455. clear_values;
  456. proc_var_openstring(value_smallstring);
  457. if (value_smallstring <> RESULT_SMALLSTRING) or (global_u8bit <> high(value_smallstring)) then
  458. failed := true;
  459. if failed then
  460. fail
  461. else
  462. WriteLn('Passed!');
  463. write('Var parameter test (src : LOC_REFERENCE (formaldef)))...');
  464. clear_globals;
  465. clear_values;
  466. failed:=false;
  467. proc_var_formaldef_array(value_smallarray);
  468. if (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) or (value_smallarray[1] <> RESULT_U8BIT) then
  469. failed := true;
  470. if failed then
  471. fail
  472. else
  473. WriteLn('Passed!');
  474. write('Var parameter test (src : LOC_REFERENCE (arraydef)))...');
  475. clear_globals;
  476. clear_values;
  477. failed:=false;
  478. value_smallarray[SMALL_INDEX] := RESULT_U8BIT;
  479. proc_var_smallarray(value_smallarray);
  480. if (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) or (value_smallarray[1] <> RESULT_U8BIT) then
  481. failed := true;
  482. clear_globals;
  483. clear_values;
  484. proc_var_smallarray_open(value_smallarray);
  485. if (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) or (value_smallarray[1] <> RESULT_U8BIT) then
  486. failed := true;
  487. (* HOW CAN ARRAY OF CONST VAR PARAMETERS BE TESTED?
  488. clear_globals;
  489. clear_values;
  490. value_u8bit := RESULT_U8BIT;
  491. value_ptr := RESULT_PCHAR;
  492. value_s64bit := RESULT_S64BIT;
  493. value_smallstring := RESULT_SMALLSTRING;
  494. value_class := tclass1.create;
  495. value_boolean := RESULT_BOOLEAN;
  496. value_char := RESULT_CHAR;
  497. value_s64real:=RESULT_S64REAL;
  498. proc_var_smallarray_var_1([value_u8bit,value_ptr,value_s64bit,value_char,value_smallstring,value_s64real,value_boolean,value_class]);
  499. if global_u8bit <> RESULT_U8BIT then
  500. failed := true;
  501. if global_char <> RESULT_CHAR then
  502. failed := true;
  503. if global_boolean <> RESULT_BOOLEAN then
  504. failed:=true;
  505. if trunc(global_s64real) <> trunc(RESULT_S64REAL) then
  506. failed := true;
  507. if global_bigstring <> RESULT_SMALLSTRING then
  508. failed := true;
  509. if global_ptr <> value_ptr then
  510. failed := true;
  511. { if value_class <> global_class then
  512. failed := true;!!!!!!!!!!!!!!!!!!!!}
  513. if global_s64bit <> RESULT_S64BIT then
  514. failed := true;
  515. if assigned(value_class) then
  516. value_class.destroy;
  517. global_u8bit := 0;
  518. proc_var_smallarray_const_2([]);
  519. if global_u8bit <> RESULT_U8BIT then
  520. failed := true;
  521. *)
  522. if failed then
  523. fail
  524. else
  525. WriteLn('Passed!');
  526. {***************************** MIXED TESTS *******************************}
  527. clear_globals;
  528. clear_values;
  529. failed:=false;
  530. write('Var parameter test (src : LOC_REFERENCE (orddef)))...');
  531. proc_var_s32bit_mixed(RESULT_U8BIT, global_s32bit, RESULT_U8BIT);
  532. if global_s32bit <> RESULT_S32BIT then
  533. failed:=true;
  534. if value_u8bit <> RESULT_U8BIT then
  535. failed := true;
  536. clear_globals;
  537. clear_values;
  538. proc_var_s64bit_mixed(RESULT_U8BIT, global_s64bit, RESULT_U8BIT);
  539. if global_s64bit <> RESULT_S64BIT then
  540. failed:=true;
  541. if value_u8bit <> RESULT_U8BIT then
  542. failed := true;
  543. clear_globals;
  544. clear_values;
  545. proc_var_u8bit_mixed(RESULT_U8BIT, global_u8bit, RESULT_U8BIT);
  546. if global_u8bit <> RESULT_U8BIT then
  547. failed:=true;
  548. if value_u8bit <> RESULT_U8BIT then
  549. failed := true;
  550. if failed then
  551. fail
  552. else
  553. WriteLn('Passed!');
  554. write('Var parameter test (src : LOC_REFERENCE (recorddef)))...');
  555. clear_globals;
  556. clear_values;
  557. failed := false;
  558. proc_var_smallrecord_mixed(RESULT_U8BIT,value_smallrec, RESULT_U8BIT);
  559. if (value_smallrec.b <> RESULT_U8BIT) or (value_smallrec.w <> RESULT_U16BIT) then
  560. failed := true;
  561. if value_u8bit <> RESULT_U8BIT then
  562. failed := true;
  563. clear_globals;
  564. clear_values;
  565. proc_var_largerecord_mixed(RESULT_U8BIT, value_largerec, RESULT_U8BIT);
  566. if (value_largerec.b[1] <> RESULT_U8BIT) or (value_largerec.b[2] <> RESULT_U8BIT) then
  567. failed := true;
  568. if value_u8bit <> RESULT_U8BIT then
  569. failed := true;
  570. if failed then
  571. fail
  572. else
  573. WriteLn('Passed!');
  574. write('var parameter test (src : LOC_REFERENCE (setdef)))...');
  575. clear_globals;
  576. clear_values;
  577. failed := false;
  578. proc_var_smallset_mixed(RESULT_U8BIT, value_smallset, RESULT_U8BIT);
  579. if (not (A_A in value_smallset)) or (not (A_D in value_smallset)) then
  580. failed := true;
  581. if value_u8bit <> RESULT_U8BIT then
  582. failed := true;
  583. clear_globals;
  584. clear_values;
  585. proc_var_largeset_mixed(RESULT_U8BIT, value_largeset, RESULT_U8BIT);
  586. if not ('I' in value_largeset) then
  587. failed := true;
  588. if value_u8bit <> RESULT_U8BIT then
  589. failed := true;
  590. if failed then
  591. fail
  592. else
  593. WriteLn('Passed!');
  594. write('var parameter test (src : LOC_REFERENCE (stringdef)))...');
  595. clear_globals;
  596. clear_values;
  597. failed := false;
  598. proc_var_smallstring_mixed(RESULT_U8BIT, value_smallstring, RESULT_U8BIT);
  599. if value_smallstring <> RESULT_SMALLSTRING then
  600. failed := true;
  601. if value_u8bit <> RESULT_U8BIT then
  602. failed := true;
  603. clear_globals;
  604. clear_values;
  605. proc_var_bigstring_mixed(RESULT_U8BIT, value_bigstring,RESULT_U8BIT);
  606. if value_bigstring <> RESULT_BIGSTRING then
  607. failed := true;
  608. if value_u8bit <> RESULT_U8BIT then
  609. failed := true;
  610. clear_globals;
  611. clear_values;
  612. proc_var_openstring_mixed(RESULT_U8BIT, value_smallstring, RESULT_U8BIT);
  613. if (value_smallstring <> RESULT_SMALLSTRING) or (global_u8bit <> high(value_smallstring)) then
  614. failed := true;
  615. if value_u8bit <> RESULT_U8BIT then
  616. failed := true;
  617. if failed then
  618. fail
  619. else
  620. WriteLn('Passed!');
  621. write('Var parameter test (src : LOC_REFERENCE (formaldef)))...');
  622. clear_globals;
  623. clear_values;
  624. failed:=false;
  625. proc_var_formaldef_array_mixed(RESULT_U8BIT, value_smallarray, RESULT_U8BIT);
  626. if (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) or (value_smallarray[1] <> RESULT_U8BIT) then
  627. failed := true;
  628. if value_u8bit <> RESULT_U8BIT then
  629. failed := true;
  630. if failed then
  631. fail
  632. else
  633. WriteLn('Passed!');
  634. write('Var parameter test (src : LOC_REFERENCE (arraydef)))...');
  635. clear_globals;
  636. clear_values;
  637. failed:=false;
  638. value_smallarray[SMALL_INDEX] := RESULT_U8BIT;
  639. proc_var_smallarray_mixed(RESULT_U8BIT, value_smallarray, RESULT_U8BIT);
  640. if (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) or (value_smallarray[1] <> RESULT_U8BIT) then
  641. failed := true;
  642. if value_u8bit <> RESULT_U8BIT then
  643. failed := true;
  644. clear_globals;
  645. clear_values;
  646. proc_var_smallarray_open_mixed(RESULT_U8BIT, value_smallarray, RESULT_U8BIT);
  647. if (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) or (value_smallarray[1] <> RESULT_U8BIT) then
  648. failed := true;
  649. if value_u8bit <> RESULT_U8BIT then
  650. failed := true;
  651. if failed then
  652. fail
  653. else
  654. WriteLn('Passed!');
  655. end.
  656. {
  657. $Log$
  658. Revision 1.4 2002-09-22 09:08:41 carl
  659. * gets64bit was not returning an int64!
  660. Revision 1.3 2002/09/07 15:40:55 peter
  661. * old logs removed and tabs fixed
  662. Revision 1.2 2002/05/13 13:45:38 peter
  663. * updated to compile tests with kylix
  664. Revision 1.1 2002/04/10 16:33:19 carl
  665. + first tries at first calln testing
  666. }