twasmfuncref1.pp 744 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. { %cpu=wasm32 }
  2. { %norun }
  3. program twasmfuncref1;
  4. {$MODE fpc}
  5. type
  6. TWasmFuncRef = function(a: longint; b: int64): longint; WasmFuncRef;
  7. procedure testproc;
  8. var
  9. p: TWasmFuncRef;
  10. begin
  11. end;
  12. procedure testproc2(q: TWasmFuncRef);
  13. begin
  14. end;
  15. function testproc3: TWasmFuncRef;
  16. begin
  17. end;
  18. function testproc4(a, b, c: longint; d: TWasmFuncRef; e: int64): TWasmFuncRef;
  19. var
  20. q: TWasmFuncRef;
  21. begin
  22. q := d;
  23. testproc4 := q;
  24. end;
  25. function testproc5(q: TWasmFuncRef): TWasmFuncRef;
  26. var
  27. w: TWasmFuncRef;
  28. begin
  29. w := nil;
  30. testproc5 := nil;
  31. end;
  32. function testproc6: Boolean;
  33. var
  34. q: TWasmFuncRef;
  35. begin
  36. testproc6 := q = nil;
  37. testproc6 := nil = q;
  38. testproc6 := q <> nil;
  39. testproc6 := nil <> q;
  40. end;
  41. begin
  42. testproc5(nil);
  43. end.