瀏覽代碼

Merged revisions 8931-8932,8945,8947-8948,8993,9013-9014,9034,9037,9039,9050,9056 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r8931 | jonas | 2007-10-25 21:30:48 +0200 (Thu, 25 Oct 2007) | 3 lines

* don't add target_info.unit_env to the unit search path
if it's not set/empty

........
r8932 | jonas | 2007-10-25 21:41:56 +0200 (Thu, 25 Oct 2007) | 2 lines

* test for mantis #9450 (forgot to commit earlier)

........
r8945 | jonas | 2007-10-26 14:36:38 +0200 (Fri, 26 Oct 2007) | 5 lines

* add all implicit units (system, objpas, variants, cmem, ...) using
their name in all lower case, so the compiler doesn't waste time
searching for System.ppu/System.pas/System.pp/... on case-sensitive
file systems

........
r8947 | jonas | 2007-10-26 15:48:36 +0200 (Fri, 26 Oct 2007) | 7 lines

* updated program/script to generate all variant overload tests to merge
most tests which have to succeed (except the extended ones, as they
have to succeed on some and fail on other platforms) in a single file
to speed up testing (the ivarol*.pp files can also still be compiled
separately, but the testsuite will only compile the tnofalvarol
program which includes them all)

........
r8948 | jonas | 2007-10-26 20:22:30 +0200 (Fri, 26 Oct 2007) | 6 lines

* fixed bug in typed constant record parsing with variant records
in case a variant part other than the first is initialised (the
index of the next symbol was not adjusted, causing incorrect error
messages in case there are some alignment bits/bytes between the
previous and next field)

........
r8993 | jonas | 2007-10-29 20:00:15 +0100 (Mon, 29 Oct 2007) | 3 lines

* fixed pic reference loading for non-darwin i386 platforms after
r8657

........
r9013 | jonas | 2007-10-31 13:37:35 +0100 (Wed, 31 Oct 2007) | 3 lines

* save/restore true/false label when secondpassing arrayconstructor
elements (mantis #10072)

........
r9014 | jonas | 2007-10-31 16:11:13 +0100 (Wed, 31 Oct 2007) | 2 lines

* fixed comparisons of orddefs with fourcharcodes in macpas mode + test

........
r9034 | jonas | 2007-11-01 13:45:33 +0100 (Thu, 01 Nov 2007) | 2 lines

* fixed range errors (mantis #10079)

........
r9037 | jonas | 2007-11-01 14:31:23 +0100 (Thu, 01 Nov 2007) | 4 lines

* fixed a_load_reg_ref: the store size has to depend on the tosize,
not on the fromsize (fixes webtbs/tw10072, and hopefully also
resolves mantis #8121)

........
r9039 | jonas | 2007-11-01 14:53:55 +0100 (Thu, 01 Nov 2007) | 3 lines

* fixed some tests involving extended/double/currency after previous
optimization

........
r9050 | jonas | 2007-11-01 17:27:41 +0100 (Thu, 01 Nov 2007) | 3 lines

* remove procedures with var/out parameters which are supposed to
be passed a constant expression from the overload candidates

........
r9056 | jonas | 2007-11-02 10:51:23 +0100 (Fri, 02 Nov 2007) | 2 lines

* ifdef cpupowerpc -> ifdef cpupowerpc32

........

git-svn-id: branches/fixes_2_2@9059 -

Jonas Maebe 18 年之前
父節點
當前提交
dcf086bacd
共有 100 個文件被更改,包括 5051 次插入171 次删除
  1. 139 133
      .gitattributes
  2. 6 3
      compiler/htypechk.pas
  3. 28 1
      compiler/nadd.pas
  4. 18 2
      compiler/ncgld.pas
  5. 6 1
      compiler/options.pas
  6. 10 10
      compiler/pmodules.pas
  7. 5 2
      compiler/ptconst.pas
  8. 1 1
      compiler/sparc/cgcpu.pas
  9. 3 1
      compiler/x86/cgx86.pas
  10. 5 5
      packages/extra/chm/chmwriter.pas
  11. 54 0
      tests/test/cg/variants/ivarol10.pp
  12. 54 0
      tests/test/cg/variants/ivarol100.pp
  13. 54 0
      tests/test/cg/variants/ivarol101.pp
  14. 54 0
      tests/test/cg/variants/ivarol102.pp
  15. 54 0
      tests/test/cg/variants/ivarol104.pp
  16. 54 0
      tests/test/cg/variants/ivarol105.pp
  17. 54 0
      tests/test/cg/variants/ivarol106.pp
  18. 54 0
      tests/test/cg/variants/ivarol107.pp
  19. 54 0
      tests/test/cg/variants/ivarol108.pp
  20. 54 0
      tests/test/cg/variants/ivarol109.pp
  21. 54 0
      tests/test/cg/variants/ivarol11.pp
  22. 54 0
      tests/test/cg/variants/ivarol110.pp
  23. 54 0
      tests/test/cg/variants/ivarol111.pp
  24. 54 0
      tests/test/cg/variants/ivarol112.pp
  25. 54 0
      tests/test/cg/variants/ivarol113.pp
  26. 54 0
      tests/test/cg/variants/ivarol115.pp
  27. 54 0
      tests/test/cg/variants/ivarol116.pp
  28. 54 0
      tests/test/cg/variants/ivarol118.pp
  29. 54 0
      tests/test/cg/variants/ivarol119.pp
  30. 54 0
      tests/test/cg/variants/ivarol120.pp
  31. 54 0
      tests/test/cg/variants/ivarol121.pp
  32. 54 0
      tests/test/cg/variants/ivarol122.pp
  33. 54 0
      tests/test/cg/variants/ivarol123.pp
  34. 54 0
      tests/test/cg/variants/ivarol125.pp
  35. 54 0
      tests/test/cg/variants/ivarol126.pp
  36. 54 0
      tests/test/cg/variants/ivarol127.pp
  37. 54 0
      tests/test/cg/variants/ivarol128.pp
  38. 54 0
      tests/test/cg/variants/ivarol129.pp
  39. 54 0
      tests/test/cg/variants/ivarol130.pp
  40. 54 0
      tests/test/cg/variants/ivarol131.pp
  41. 54 0
      tests/test/cg/variants/ivarol132.pp
  42. 54 0
      tests/test/cg/variants/ivarol134.pp
  43. 54 0
      tests/test/cg/variants/ivarol135.pp
  44. 54 0
      tests/test/cg/variants/ivarol136.pp
  45. 54 0
      tests/test/cg/variants/ivarol137.pp
  46. 54 0
      tests/test/cg/variants/ivarol138.pp
  47. 54 0
      tests/test/cg/variants/ivarol139.pp
  48. 54 0
      tests/test/cg/variants/ivarol140.pp
  49. 54 0
      tests/test/cg/variants/ivarol141.pp
  50. 54 0
      tests/test/cg/variants/ivarol142.pp
  51. 54 0
      tests/test/cg/variants/ivarol143.pp
  52. 54 0
      tests/test/cg/variants/ivarol144.pp
  53. 54 0
      tests/test/cg/variants/ivarol145.pp
  54. 54 0
      tests/test/cg/variants/ivarol146.pp
  55. 54 0
      tests/test/cg/variants/ivarol147.pp
  56. 54 0
      tests/test/cg/variants/ivarol148.pp
  57. 54 0
      tests/test/cg/variants/ivarol149.pp
  58. 54 0
      tests/test/cg/variants/ivarol15.pp
  59. 54 0
      tests/test/cg/variants/ivarol150.pp
  60. 54 0
      tests/test/cg/variants/ivarol151.pp
  61. 54 0
      tests/test/cg/variants/ivarol152.pp
  62. 54 0
      tests/test/cg/variants/ivarol153.pp
  63. 54 0
      tests/test/cg/variants/ivarol155.pp
  64. 54 0
      tests/test/cg/variants/ivarol156.pp
  65. 54 0
      tests/test/cg/variants/ivarol158.pp
  66. 54 0
      tests/test/cg/variants/ivarol160.pp
  67. 54 0
      tests/test/cg/variants/ivarol161.pp
  68. 54 0
      tests/test/cg/variants/ivarol162.pp
  69. 54 0
      tests/test/cg/variants/ivarol164.pp
  70. 54 0
      tests/test/cg/variants/ivarol165.pp
  71. 54 0
      tests/test/cg/variants/ivarol166.pp
  72. 54 0
      tests/test/cg/variants/ivarol167.pp
  73. 54 0
      tests/test/cg/variants/ivarol169.pp
  74. 54 0
      tests/test/cg/variants/ivarol17.pp
  75. 54 0
      tests/test/cg/variants/ivarol170.pp
  76. 54 0
      tests/test/cg/variants/ivarol171.pp
  77. 54 0
      tests/test/cg/variants/ivarol18.pp
  78. 54 0
      tests/test/cg/variants/ivarol19.pp
  79. 24 12
      tests/test/cg/variants/ivarol2.pp
  80. 54 0
      tests/test/cg/variants/ivarol21.pp
  81. 54 0
      tests/test/cg/variants/ivarol22.pp
  82. 54 0
      tests/test/cg/variants/ivarol23.pp
  83. 54 0
      tests/test/cg/variants/ivarol24.pp
  84. 54 0
      tests/test/cg/variants/ivarol25.pp
  85. 54 0
      tests/test/cg/variants/ivarol26.pp
  86. 54 0
      tests/test/cg/variants/ivarol27.pp
  87. 54 0
      tests/test/cg/variants/ivarol28.pp
  88. 54 0
      tests/test/cg/variants/ivarol29.pp
  89. 54 0
      tests/test/cg/variants/ivarol32.pp
  90. 54 0
      tests/test/cg/variants/ivarol34.pp
  91. 54 0
      tests/test/cg/variants/ivarol35.pp
  92. 54 0
      tests/test/cg/variants/ivarol36.pp
  93. 54 0
      tests/test/cg/variants/ivarol37.pp
  94. 54 0
      tests/test/cg/variants/ivarol38.pp
  95. 54 0
      tests/test/cg/variants/ivarol39.pp
  96. 54 0
      tests/test/cg/variants/ivarol40.pp
  97. 54 0
      tests/test/cg/variants/ivarol41.pp
  98. 54 0
      tests/test/cg/variants/ivarol42.pp
  99. 54 0
      tests/test/cg/variants/ivarol43.pp
  100. 54 0
      tests/test/cg/variants/ivarol44.pp

+ 139 - 133
.gitattributes

@@ -6670,177 +6670,178 @@ tests/test/cg/ttryfin3.pp svneol=native#text/plain
 tests/test/cg/ttryfin4.pp svneol=native#text/plain
 tests/test/cg/tvec.pp svneol=native#text/plain
 tests/test/cg/uprintf3.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol10.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol100.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol101.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol102.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol104.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol105.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol106.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol107.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol108.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol109.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol11.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol110.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol111.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol112.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol113.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol115.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol116.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol118.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol119.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol120.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol121.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol122.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol123.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol125.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol126.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol127.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol128.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol129.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol130.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol131.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol132.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol134.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol135.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol136.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol137.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol138.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol139.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol140.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol141.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol142.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol143.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol144.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol145.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol146.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol147.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol148.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol149.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol15.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol150.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol151.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol152.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol153.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol155.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol156.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol158.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol160.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol161.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol162.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol164.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol165.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol166.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol167.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol169.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol17.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol170.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol171.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol18.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol19.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol2.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol21.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol22.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol23.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol24.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol25.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol26.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol27.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol28.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol29.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol32.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol34.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol35.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol36.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol37.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol38.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol39.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol40.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol41.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol42.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol43.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol44.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol45.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol46.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol47.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol49.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol50.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol52.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol53.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol54.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol55.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol56.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol57.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol58.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol59.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol60.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol63.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol65.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol66.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol68.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol69.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol70.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol71.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol72.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol73.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol74.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol75.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol76.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol77.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol79.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol80.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol81.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol83.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol85.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol86.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol87.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol88.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol89.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol90.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol92.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol93.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol95.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol97.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol98.pp svneol=native#text/plain
+tests/test/cg/variants/ivarol99.pp svneol=native#text/plain
+tests/test/cg/variants/tnofalvarol.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol1.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol10.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol100.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol101.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol102.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol103.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol104.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol105.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol106.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol107.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol108.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol109.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol11.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol110.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol111.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol112.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol113.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol114.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol115.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol116.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol117.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol118.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol119.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol12.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol120.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol121.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol122.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol123.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol124.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol125.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol126.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol127.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol128.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol129.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol13.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol130.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol131.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol132.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol133.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol134.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol135.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol136.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol137.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol138.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol139.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol14.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol140.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol141.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol142.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol143.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol144.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol145.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol146.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol147.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol148.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol149.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol15.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol150.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol151.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol152.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol153.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol154.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol155.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol156.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol157.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol158.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol159.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol16.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol160.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol161.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol162.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol163.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol164.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol165.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol166.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol167.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol168.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol169.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol17.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol170.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol171.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol18.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol19.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol2.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol20.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol21.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol22.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol23.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol24.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol25.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol26.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol27.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol28.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol29.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol3.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol30.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol31.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol32.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol33.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol34.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol35.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol36.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol37.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol38.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol39.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol4.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol40.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol41.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol42.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol43.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol44.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol45.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol46.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol47.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol48.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol49.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol5.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol50.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol51.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol52.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol53.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol54.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol55.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol56.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol57.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol58.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol59.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol6.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol60.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol61.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol62.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol63.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol64.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol65.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol66.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol67.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol68.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol69.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol7.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol70.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol71.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol72.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol73.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol74.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol75.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol76.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol77.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol78.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol79.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol8.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol80.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol81.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol82.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol83.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol84.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol85.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol86.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol87.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol88.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol89.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol9.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol90.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol91.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol92.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol93.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol94.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol95.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol96.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol97.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol98.pp svneol=native#text/plain
-tests/test/cg/variants/tvarol99.pp svneol=native#text/plain
 tests/test/dumpclass.pp svneol=native#text/plain
 tests/test/dumpmethods.pp svneol=native#text/plain
 tests/test/opt/README -text
@@ -6980,6 +6981,7 @@ tests/test/tmacpas1.pp svneol=native#text/plain
 tests/test/tmacpas2.pp svneol=native#text/plain
 tests/test/tmacpas3.pp svneol=native#text/plain
 tests/test/tmacpas4.pp svneol=native#text/plain
+tests/test/tmacpas5.pp svneol=native#text/plain
 tests/test/tmacprocvar.pp svneol=native#text/plain
 tests/test/tmath1.pp svneol=native#text/plain
 tests/test/tmcbool2.pp svneol=native#text/plain
@@ -7040,6 +7042,7 @@ tests/test/tprec18.pp svneol=native#text/plain
 tests/test/tprec19.pp svneol=native#text/plain
 tests/test/tprec2.pp svneol=native#text/plain
 tests/test/tprec20.pp svneol=native#text/plain
+tests/test/tprec21.pp svneol=native#text/plain
 tests/test/tprec3.pp svneol=native#text/plain
 tests/test/tprec4.pp svneol=native#text/plain
 tests/test/tprec5.pp svneol=native#text/plain
@@ -7569,6 +7572,7 @@ tests/webtbs/tw0965.pp svneol=native#text/plain
 tests/webtbs/tw0966.pp svneol=native#text/plain
 tests/webtbs/tw0976.pp svneol=native#text/plain
 tests/webtbs/tw10013.pp svneol=native#text/plain
+tests/webtbs/tw10072.pp svneol=native#text/plain
 tests/webtbs/tw1021.pp svneol=native#text/plain
 tests/webtbs/tw1023.pp svneol=native#text/plain
 tests/webtbs/tw1041.pp svneol=native#text/plain
@@ -8442,6 +8446,8 @@ tests/webtbs/tw9347a.pp svneol=native#text/plain
 tests/webtbs/tw9347b.pp svneol=native#text/plain
 tests/webtbs/tw9385.pp svneol=native#text/plain
 tests/webtbs/tw9419.pp svneol=native#text/plain
+tests/webtbs/tw9450.pp svneol=native#text/plain
+tests/webtbs/tw9450a.pp svneol=native#text/plain
 tests/webtbs/tw9461.pp svneol=native#text/plain
 tests/webtbs/tw9509.pp svneol=native#text/plain
 tests/webtbs/tw9601.pp svneol=native#text/plain

+ 6 - 3
compiler/htypechk.pas

@@ -1439,7 +1439,7 @@ implementation
       end;
 
 
-    procedure var_para_allowed(var eq:tequaltype;def_from,def_to:Tdef);
+    procedure var_para_allowed(var eq:tequaltype;def_from,def_to:Tdef; fromnode: tnode);
       begin
         { Note: eq must be already valid, it will only be updated! }
         case def_to.typ of
@@ -1447,7 +1447,10 @@ implementation
             begin
               { all types can be passed to a formaldef,
                 but it is not the prefered way }
-              eq:=te_convert_l2;
+              if not is_constnode(fromnode) then
+                eq:=te_convert_l2
+              else
+                eq:=te_incompatible;
             end;
           orddef :
             begin
@@ -2135,7 +2138,7 @@ implementation
                         eq:=te_incompatible;
                         { var_para_allowed will return te_equal and te_convert_l1 to
                           make a difference for best matching }
-                        var_para_allowed(eq,currpt.resultdef,currpara.vardef)
+                        var_para_allowed(eq,currpt.resultdef,currpara.vardef,currpt.left)
                       end
                     else
                       para_allowed(eq,currpt,def_to);

+ 28 - 1
compiler/nadd.pas

@@ -908,6 +908,33 @@ implementation
         rt:=right.nodetype;
         lt:=left.nodetype;
 
+         { 4 character constant strings are compatible with orddef }
+         { in macpas mode (become cardinals)                       }
+         if (m_mac in current_settings.modeswitches) and
+            { only allow for comparisons, additions etc are }
+            { normally program errors                       }
+            (nodetype in [ltn,lten,gtn,gten,unequaln,equaln]) and
+            (((lt=stringconstn) and
+              (tstringconstnode(left).len=4) and
+              (rd.typ=orddef)) or
+             ((rt=stringconstn) and
+              (tstringconstnode(right).len=4) and
+              (ld.typ=orddef))) then
+           begin
+             if (rt=stringconstn) then
+               begin
+                 inserttypeconv(right,u32inttype);
+                 rt:=right.nodetype;
+                 rd:=right.resultdef;
+               end
+             else
+               begin
+                 inserttypeconv(left,u32inttype);
+                 lt:=left.nodetype;
+                 ld:=left.resultdef;
+               end;
+           end;
+
          { but an int/int gives real/real! }
          if (nodetype=slashn) and not(is_vector(left.resultdef)) and not(is_vector(right.resultdef)) then
           begin
@@ -1378,7 +1405,7 @@ implementation
                             CGMessage1(type_w_untyped_arithmetic_unportable,node2opstr(nodetype));
                           inserttypeconv(right,left.resultdef)
                         end
-			else if is_voidpointer(left.resultdef) then
+                        else if is_voidpointer(left.resultdef) then
                           inserttypeconv(left,right.resultdef)
                         else if not(equal_defs(ld,rd)) then
                           IncompatibleTypes(ld,rd);

+ 18 - 2
compiler/ncgld.pas

@@ -751,6 +751,8 @@ implementation
         elesize : longint;
         tmpreg  : tregister;
         paraloc : tcgparalocation;
+        otlabel,
+        oflabel : tasmlabel;
       begin
         if is_packed_array(resultdef) then
           internalerror(200608042);
@@ -775,12 +777,26 @@ implementation
            if assigned(hp.left) then
             begin
               freetemp:=true;
+              if (hp.left.expectloc=LOC_JUMP) then
+                begin
+                  otlabel:=current_procinfo.CurrTrueLabel;
+                  oflabel:=current_procinfo.CurrFalseLabel;
+                  current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
+                  current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
+                end;
               secondpass(hp.left);
-              if codegenerror then
-               exit;
               { Move flags and jump in register }
               if hp.left.location.loc in [LOC_FLAGS,LOC_JUMP] then
                 location_force_reg(current_asmdata.CurrAsmList,hp.left.location,def_cgsize(hp.left.resultdef),false);
+
+              if (hp.left.location.loc=LOC_JUMP) then
+                begin
+                  if (hp.left.expectloc<>LOC_JUMP) then
+                    internalerror(2007103101);
+                  current_procinfo.CurrTrueLabel:=otlabel;
+                  current_procinfo.CurrFalseLabel:=oflabel;
+                end;
+
               if dovariant then
                begin
                  { find the correct vtype value }

+ 6 - 1
compiler/options.pas

@@ -2068,6 +2068,7 @@ end;
 
 procedure read_arguments(cmd:string);
 var
+  env: ansistring;
   i : tfeature;
 begin
   option:=coption.create;
@@ -2330,7 +2331,11 @@ begin
   if inputfilepath<>'' then
    Unitsearchpath.AddPath(inputfilepath,true);
   if not disable_configfile then
-    UnitSearchPath.AddPath(GetEnvironmentVariable(target_info.unit_env),false);
+    begin
+      env:=GetEnvironmentVariable(target_info.unit_env);
+      if env<>'' then
+        UnitSearchPath.AddPath(GetEnvironmentVariable(target_info.unit_env),false);
+    end;
 
 {$ifdef Unix}
   fpcdir:=FixPath(GetEnvironmentVariable('FPCDIR'),false);

+ 10 - 10
compiler/pmodules.pas

@@ -440,7 +440,7 @@ implementation
           end;
         { Variants unit is not loaded yet, load it now }
         Message(parser_w_implicit_uses_of_variants_unit);
-        AddUnit('Variants');
+        AddUnit('variants');
       end;
 
 
@@ -469,7 +469,7 @@ implementation
 
         { insert the system unit, it is allways the first. Load also the
           internal types from the system unit }
-        AddUnit('System');
+        AddUnit('system');
         systemunit:=tglobalsymtable(symtablestack.top);
         load_intern_types;
 
@@ -483,7 +483,7 @@ implementation
          begin
            { Heaptrc unit, load heaptrace before any other units especially objpas }
            if (cs_use_heaptrc in current_settings.globalswitches) then
-             AddUnit('HeapTrc');
+             AddUnit('heaptrc');
            { Lineinfo unit }
            if (cs_use_lineinfo in current_settings.globalswitches) then begin
              if (paratargetdbg = dbg_stabs) then
@@ -493,29 +493,29 @@ implementation
            end;
            { Valgrind requires c memory manager }
            if (cs_gdb_valgrind in current_settings.globalswitches) then
-             AddUnit('CMem');
+             AddUnit('cmem');
 {$ifdef cpufpemu}
            { Floating point emulation unit?
              softfpu must be in the system unit anyways (FK)
            if (cs_fp_emulation in current_settings.moduleswitches) and not(target_info.system in system_wince) then
-             AddUnit('SoftFpu');
+             AddUnit('softfpu');
            }
 {$endif cpufpemu}
          end;
         { Objpas unit? }
         if m_objpas in current_settings.modeswitches then
-          AddUnit('ObjPas');
+          AddUnit('objpas');
         { Macpas unit? }
         if m_mac in current_settings.modeswitches then
-          AddUnit('MacPas');
+          AddUnit('macpas');
         { Profile unit? Needed for go32v2 only }
         if (cs_profile in current_settings.moduleswitches) and
            (target_info.system in [system_i386_go32v2,system_i386_watcom]) then
-          AddUnit('Profile');
+          AddUnit('profile');
         if (cs_load_fpcylix_unit in current_settings.globalswitches) then
           begin
-            AddUnit('FPCylix');
-            AddUnit('DynLibs');
+            AddUnit('fpcylix');
+            AddUnit('dynlibs');
           end;
       end;
 

+ 5 - 2
compiler/ptconst.pas

@@ -1039,7 +1039,10 @@ implementation
                      {        end;                                        }
                      {   const r: tr = (w1:1;w2:1;l2:5);                  }
                      (tfieldvarsym(recsym).fieldoffset = curroffset) then
-                    srsym := recsym
+                    begin
+                      srsym := recsym;
+                      symidx := def.symtable.SymList.indexof(srsym)
+                    end
                   { going backwards isn't allowed in any mode }
                   else if (tfieldvarsym(recsym).fieldoffset<curroffset) then
                     begin
@@ -1123,7 +1126,7 @@ implementation
             end;
 
           { are there any fields left, but don't complain if there only
-            come other variant partsa fter the last initialized field }
+            come other variant parts after the last initialized field }
           if assigned(srsym) and
              (
               (recsym=nil) or

+ 1 - 1
compiler/sparc/cgcpu.pas

@@ -489,7 +489,7 @@ implementation
           end
         else
           begin
-            case fromsize of
+            case tosize of
               { signed integer registers }
               OS_8,
               OS_S8:

+ 3 - 1
compiler/x86/cgx86.pas

@@ -435,9 +435,11 @@ unit cgx86;
            not((ref.symbol.bind=AB_LOCAL) and
                (ref.symbol.typ in [AT_LABEL,AT_FUNCTION])) then
           begin
-            href.refaddr:=addr_pic;
+            reference_reset_symbol(href,ref.symbol,0);
             href.base:=current_procinfo.got;
+            href.refaddr:=addr_pic;
             include(current_procinfo.flags,pi_needs_got);
+            hreg:=cg.getaddressregister(list);
             list.concat(taicpu.op_ref_reg(A_MOV,S_L,href,hreg));
             ref.symbol:=nil;
             add_hreg:=true;

+ 5 - 5
packages/extra/chm/chmwriter.pas

@@ -186,14 +186,14 @@ begin
     //FirstPMGLChunkIndex,
     //LastPMGLChunkIndex: LongWord;
     
-    Unknown2 := NToLE(DWord(-1));
+    Unknown2 := NToLE(Longint(-1));
     //DirectoryChunkCount: LongWord;
     LanguageID := NToLE(DWord($0409));
     GUID := ITSPHeaderGUID;
     LengthAgain := NToLE(DWord($54));
-    Unknown3 := NToLE(DWord(-1));
-    Unknown4 := NToLE(DWOrd(-1));
-    Unknown5 := NToLE(DWord(-1));
+    Unknown3 := NToLE(Longint(-1));
+    Unknown4 := NToLE(Longint(-1));
+    Unknown5 := NToLE(Longint(-1));
   end;
   
   // more endian stuff
@@ -284,7 +284,7 @@ const
       UnusedSpace := NToLE(ListingBlock.FreeSpace);
       Unknown1 :=  0;
       PreviousChunkIndex := NToLE(LastListIndex);
-      NextChunkIndex := NToLE(DWord(-1)); // we update this when we write the next chunk
+      NextChunkIndex := NToLE(Longint(-1)); // we update this when we write the next chunk
     end;
     if HeaderSection1.FirstPMGLChunkIndex <= 0 then
       HeaderSection1.FirstPMGLChunkIndex := NToLE(ChunkIndex);

+ 54 - 0
tests/test/cg/variants/ivarol10.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp10 = double;
+{$else FPC_COMP_IS_INT64}
+  comp10 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test10(var a); overload;
+  begin
+    writeln('formal called instead of shortstring');
+  end;
+
+procedure test10(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of formal');
+    halt(1)
+  end;
+
+var
+  x10: longint;
+
+  y10: shortstring;
+procedure dotest10;
+var
+  v: variant;
+
+begin
+  try
+    v := x10;
+    test10(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y10;
+    test10(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest10;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol100.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp100 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp100 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test100(a: word); overload;
+  begin
+    writeln('word called instead of double');
+  end;
+
+procedure test100(a: double); overload;
+  begin
+    writeln('double called instead of word');
+    halt(1)
+  end;
+
+var
+  x100: word;
+
+  y100: double;
+procedure dotest100;
+var
+  v: variant;
+
+begin
+  try
+    v := x100;
+    test100(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y100;
+    test100(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest100;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol101.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp101 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp101 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test101(a: word); overload;
+  begin
+    writeln('word called instead of extended');
+  end;
+
+procedure test101(a: extended); overload;
+  begin
+    writeln('extended called instead of word');
+    halt(1)
+  end;
+
+var
+  x101: word;
+
+  y101: extended;
+procedure dotest101;
+var
+  v: variant;
+
+begin
+  try
+    v := x101;
+    test101(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y101;
+    test101(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest101;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol102.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp102 = double;
+{$else FPC_COMP_IS_INT64}
+  comp102 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test102(a: word); overload;
+  begin
+    writeln('word called instead of char');
+  end;
+
+procedure test102(a: char); overload;
+  begin
+    writeln('char called instead of word');
+    halt(1)
+  end;
+
+var
+  x102: word;
+
+  y102: char;
+procedure dotest102;
+var
+  v: variant;
+
+begin
+  try
+    v := x102;
+    test102(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y102;
+    test102(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest102;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol104.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp104 = double;
+{$else FPC_COMP_IS_INT64}
+  comp104 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test104(a: word); overload;
+  begin
+    writeln('word called instead of widestring');
+  end;
+
+procedure test104(a: widestring); overload;
+  begin
+    writeln('widestring called instead of word');
+    halt(1)
+  end;
+
+var
+  x104: word;
+
+  y104: widestring;
+procedure dotest104;
+var
+  v: variant;
+
+begin
+  try
+    v := x104;
+    test104(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y104;
+    test104(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest104;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol105.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp105 = double;
+{$else FPC_COMP_IS_INT64}
+  comp105 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test105(a: word); overload;
+  begin
+    writeln('word called instead of widechar');
+  end;
+
+procedure test105(a: widechar); overload;
+  begin
+    writeln('widechar called instead of word');
+    halt(1)
+  end;
+
+var
+  x105: word;
+
+  y105: widechar;
+procedure dotest105;
+var
+  v: variant;
+
+begin
+  try
+    v := x105;
+    test105(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y105;
+    test105(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest105;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol106.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp106 = double;
+{$else FPC_COMP_IS_INT64}
+  comp106 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test106(a: smallint); overload;
+  begin
+    writeln('smallint called instead of byte');
+    halt(1)
+  end;
+
+procedure test106(a: byte); overload;
+  begin
+    writeln('byte called instead of smallint');
+  end;
+
+var
+  x106: smallint;
+
+  y106: byte;
+procedure dotest106;
+var
+  v: variant;
+
+begin
+  try
+    v := x106;
+    test106(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y106;
+    test106(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest106;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol107.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp107 = double;
+{$else FPC_COMP_IS_INT64}
+  comp107 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test107(a: smallint); overload;
+  begin
+    writeln('smallint called instead of shortint');
+    halt(1)
+  end;
+
+procedure test107(a: shortint); overload;
+  begin
+    writeln('shortint called instead of smallint');
+  end;
+
+var
+  x107: smallint;
+
+  y107: shortint;
+procedure dotest107;
+var
+  v: variant;
+
+begin
+  try
+    v := x107;
+    test107(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y107;
+    test107(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest107;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol108.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp108 = double;
+{$else FPC_COMP_IS_INT64}
+  comp108 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test108(a: smallint); overload;
+  begin
+    writeln('smallint called instead of shortstring');
+  end;
+
+procedure test108(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x108: smallint;
+
+  y108: shortstring;
+procedure dotest108;
+var
+  v: variant;
+
+begin
+  try
+    v := x108;
+    test108(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y108;
+    test108(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest108;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol109.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp109 = double;
+{$else FPC_COMP_IS_INT64}
+  comp109 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test109(a: smallint); overload;
+  begin
+    writeln('smallint called instead of ansistring');
+  end;
+
+procedure test109(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x109: smallint;
+
+  y109: ansistring;
+procedure dotest109;
+var
+  v: variant;
+
+begin
+  try
+    v := x109;
+    test109(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y109;
+    test109(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest109;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol11.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp11 = double;
+{$else FPC_COMP_IS_INT64}
+  comp11 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test11(var a); overload;
+  begin
+    writeln('formal called instead of ansistring');
+  end;
+
+procedure test11(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of formal');
+    halt(1)
+  end;
+
+var
+  x11: longint;
+
+  y11: ansistring;
+procedure dotest11;
+var
+  v: variant;
+
+begin
+  try
+    v := x11;
+    test11(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y11;
+    test11(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest11;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol110.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp110 = double;
+{$else FPC_COMP_IS_INT64}
+  comp110 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test110(a: smallint); overload;
+  begin
+    writeln('smallint called instead of single');
+  end;
+
+procedure test110(a: single); overload;
+  begin
+    writeln('single called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x110: smallint;
+
+  y110: single;
+procedure dotest110;
+var
+  v: variant;
+
+begin
+  try
+    v := x110;
+    test110(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y110;
+    test110(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest110;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol111.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp111 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp111 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test111(a: smallint); overload;
+  begin
+    writeln('smallint called instead of double');
+  end;
+
+procedure test111(a: double); overload;
+  begin
+    writeln('double called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x111: smallint;
+
+  y111: double;
+procedure dotest111;
+var
+  v: variant;
+
+begin
+  try
+    v := x111;
+    test111(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y111;
+    test111(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest111;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol112.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp112 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp112 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test112(a: smallint); overload;
+  begin
+    writeln('smallint called instead of extended');
+  end;
+
+procedure test112(a: extended); overload;
+  begin
+    writeln('extended called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x112: smallint;
+
+  y112: extended;
+procedure dotest112;
+var
+  v: variant;
+
+begin
+  try
+    v := x112;
+    test112(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y112;
+    test112(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest112;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol113.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp113 = double;
+{$else FPC_COMP_IS_INT64}
+  comp113 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test113(a: smallint); overload;
+  begin
+    writeln('smallint called instead of char');
+  end;
+
+procedure test113(a: char); overload;
+  begin
+    writeln('char called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x113: smallint;
+
+  y113: char;
+procedure dotest113;
+var
+  v: variant;
+
+begin
+  try
+    v := x113;
+    test113(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y113;
+    test113(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest113;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol115.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp115 = double;
+{$else FPC_COMP_IS_INT64}
+  comp115 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test115(a: smallint); overload;
+  begin
+    writeln('smallint called instead of widestring');
+  end;
+
+procedure test115(a: widestring); overload;
+  begin
+    writeln('widestring called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x115: smallint;
+
+  y115: widestring;
+procedure dotest115;
+var
+  v: variant;
+
+begin
+  try
+    v := x115;
+    test115(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y115;
+    test115(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest115;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol116.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp116 = double;
+{$else FPC_COMP_IS_INT64}
+  comp116 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test116(a: smallint); overload;
+  begin
+    writeln('smallint called instead of widechar');
+  end;
+
+procedure test116(a: widechar); overload;
+  begin
+    writeln('widechar called instead of smallint');
+    halt(1)
+  end;
+
+var
+  x116: smallint;
+
+  y116: widechar;
+procedure dotest116;
+var
+  v: variant;
+
+begin
+  try
+    v := x116;
+    test116(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y116;
+    test116(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest116;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol118.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp118 = double;
+{$else FPC_COMP_IS_INT64}
+  comp118 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test118(a: byte); overload;
+  begin
+    writeln('byte called instead of shortstring');
+  end;
+
+procedure test118(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of byte');
+    halt(1)
+  end;
+
+var
+  x118: byte;
+
+  y118: shortstring;
+procedure dotest118;
+var
+  v: variant;
+
+begin
+  try
+    v := x118;
+    test118(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y118;
+    test118(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest118;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol119.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp119 = double;
+{$else FPC_COMP_IS_INT64}
+  comp119 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test119(a: byte); overload;
+  begin
+    writeln('byte called instead of ansistring');
+  end;
+
+procedure test119(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of byte');
+    halt(1)
+  end;
+
+var
+  x119: byte;
+
+  y119: ansistring;
+procedure dotest119;
+var
+  v: variant;
+
+begin
+  try
+    v := x119;
+    test119(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y119;
+    test119(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest119;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol120.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp120 = double;
+{$else FPC_COMP_IS_INT64}
+  comp120 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test120(a: byte); overload;
+  begin
+    writeln('byte called instead of single');
+  end;
+
+procedure test120(a: single); overload;
+  begin
+    writeln('single called instead of byte');
+    halt(1)
+  end;
+
+var
+  x120: byte;
+
+  y120: single;
+procedure dotest120;
+var
+  v: variant;
+
+begin
+  try
+    v := x120;
+    test120(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y120;
+    test120(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest120;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol121.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp121 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp121 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test121(a: byte); overload;
+  begin
+    writeln('byte called instead of double');
+  end;
+
+procedure test121(a: double); overload;
+  begin
+    writeln('double called instead of byte');
+    halt(1)
+  end;
+
+var
+  x121: byte;
+
+  y121: double;
+procedure dotest121;
+var
+  v: variant;
+
+begin
+  try
+    v := x121;
+    test121(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y121;
+    test121(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest121;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol122.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp122 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp122 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test122(a: byte); overload;
+  begin
+    writeln('byte called instead of extended');
+  end;
+
+procedure test122(a: extended); overload;
+  begin
+    writeln('extended called instead of byte');
+    halt(1)
+  end;
+
+var
+  x122: byte;
+
+  y122: extended;
+procedure dotest122;
+var
+  v: variant;
+
+begin
+  try
+    v := x122;
+    test122(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y122;
+    test122(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest122;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol123.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp123 = double;
+{$else FPC_COMP_IS_INT64}
+  comp123 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test123(a: byte); overload;
+  begin
+    writeln('byte called instead of char');
+  end;
+
+procedure test123(a: char); overload;
+  begin
+    writeln('char called instead of byte');
+    halt(1)
+  end;
+
+var
+  x123: byte;
+
+  y123: char;
+procedure dotest123;
+var
+  v: variant;
+
+begin
+  try
+    v := x123;
+    test123(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y123;
+    test123(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest123;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol125.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp125 = double;
+{$else FPC_COMP_IS_INT64}
+  comp125 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test125(a: byte); overload;
+  begin
+    writeln('byte called instead of widestring');
+  end;
+
+procedure test125(a: widestring); overload;
+  begin
+    writeln('widestring called instead of byte');
+    halt(1)
+  end;
+
+var
+  x125: byte;
+
+  y125: widestring;
+procedure dotest125;
+var
+  v: variant;
+
+begin
+  try
+    v := x125;
+    test125(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y125;
+    test125(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest125;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol126.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp126 = double;
+{$else FPC_COMP_IS_INT64}
+  comp126 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test126(a: byte); overload;
+  begin
+    writeln('byte called instead of widechar');
+  end;
+
+procedure test126(a: widechar); overload;
+  begin
+    writeln('widechar called instead of byte');
+    halt(1)
+  end;
+
+var
+  x126: byte;
+
+  y126: widechar;
+procedure dotest126;
+var
+  v: variant;
+
+begin
+  try
+    v := x126;
+    test126(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y126;
+    test126(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest126;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol127.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp127 = double;
+{$else FPC_COMP_IS_INT64}
+  comp127 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test127(a: shortint); overload;
+  begin
+    writeln('shortint called instead of shortstring');
+  end;
+
+procedure test127(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x127: shortint;
+
+  y127: shortstring;
+procedure dotest127;
+var
+  v: variant;
+
+begin
+  try
+    v := x127;
+    test127(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y127;
+    test127(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest127;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol128.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp128 = double;
+{$else FPC_COMP_IS_INT64}
+  comp128 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test128(a: shortint); overload;
+  begin
+    writeln('shortint called instead of ansistring');
+  end;
+
+procedure test128(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x128: shortint;
+
+  y128: ansistring;
+procedure dotest128;
+var
+  v: variant;
+
+begin
+  try
+    v := x128;
+    test128(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y128;
+    test128(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest128;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol129.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp129 = double;
+{$else FPC_COMP_IS_INT64}
+  comp129 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test129(a: shortint); overload;
+  begin
+    writeln('shortint called instead of single');
+  end;
+
+procedure test129(a: single); overload;
+  begin
+    writeln('single called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x129: shortint;
+
+  y129: single;
+procedure dotest129;
+var
+  v: variant;
+
+begin
+  try
+    v := x129;
+    test129(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y129;
+    test129(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest129;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol130.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp130 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp130 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test130(a: shortint); overload;
+  begin
+    writeln('shortint called instead of double');
+  end;
+
+procedure test130(a: double); overload;
+  begin
+    writeln('double called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x130: shortint;
+
+  y130: double;
+procedure dotest130;
+var
+  v: variant;
+
+begin
+  try
+    v := x130;
+    test130(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y130;
+    test130(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest130;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol131.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp131 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp131 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test131(a: shortint); overload;
+  begin
+    writeln('shortint called instead of extended');
+  end;
+
+procedure test131(a: extended); overload;
+  begin
+    writeln('extended called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x131: shortint;
+
+  y131: extended;
+procedure dotest131;
+var
+  v: variant;
+
+begin
+  try
+    v := x131;
+    test131(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y131;
+    test131(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest131;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol132.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp132 = double;
+{$else FPC_COMP_IS_INT64}
+  comp132 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test132(a: shortint); overload;
+  begin
+    writeln('shortint called instead of char');
+  end;
+
+procedure test132(a: char); overload;
+  begin
+    writeln('char called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x132: shortint;
+
+  y132: char;
+procedure dotest132;
+var
+  v: variant;
+
+begin
+  try
+    v := x132;
+    test132(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y132;
+    test132(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest132;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol134.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp134 = double;
+{$else FPC_COMP_IS_INT64}
+  comp134 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test134(a: shortint); overload;
+  begin
+    writeln('shortint called instead of widestring');
+  end;
+
+procedure test134(a: widestring); overload;
+  begin
+    writeln('widestring called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x134: shortint;
+
+  y134: widestring;
+procedure dotest134;
+var
+  v: variant;
+
+begin
+  try
+    v := x134;
+    test134(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y134;
+    test134(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest134;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol135.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp135 = double;
+{$else FPC_COMP_IS_INT64}
+  comp135 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test135(a: shortint); overload;
+  begin
+    writeln('shortint called instead of widechar');
+  end;
+
+procedure test135(a: widechar); overload;
+  begin
+    writeln('widechar called instead of shortint');
+    halt(1)
+  end;
+
+var
+  x135: shortint;
+
+  y135: widechar;
+procedure dotest135;
+var
+  v: variant;
+
+begin
+  try
+    v := x135;
+    test135(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y135;
+    test135(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest135;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol136.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp136 = double;
+{$else FPC_COMP_IS_INT64}
+  comp136 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test136(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of ansistring');
+  end;
+
+procedure test136(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of shortstring');
+    halt(1)
+  end;
+
+var
+  x136: shortstring;
+
+  y136: ansistring;
+procedure dotest136;
+var
+  v: variant;
+
+begin
+  try
+    v := x136;
+    test136(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y136;
+    test136(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest136;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol137.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp137 = double;
+{$else FPC_COMP_IS_INT64}
+  comp137 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test137(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of single');
+    halt(1)
+  end;
+
+procedure test137(a: single); overload;
+  begin
+    writeln('single called instead of shortstring');
+  end;
+
+var
+  x137: shortstring;
+
+  y137: single;
+procedure dotest137;
+var
+  v: variant;
+
+begin
+  try
+    v := x137;
+    test137(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y137;
+    test137(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest137;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol138.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp138 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp138 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test138(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of double');
+    halt(1)
+  end;
+
+procedure test138(a: double); overload;
+  begin
+    writeln('double called instead of shortstring');
+  end;
+
+var
+  x138: shortstring;
+
+  y138: double;
+procedure dotest138;
+var
+  v: variant;
+
+begin
+  try
+    v := x138;
+    test138(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y138;
+    test138(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest138;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol139.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp139 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp139 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test139(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of extended');
+    halt(1)
+  end;
+
+procedure test139(a: extended); overload;
+  begin
+    writeln('extended called instead of shortstring');
+  end;
+
+var
+  x139: shortstring;
+
+  y139: extended;
+procedure dotest139;
+var
+  v: variant;
+
+begin
+  try
+    v := x139;
+    test139(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y139;
+    test139(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest139;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol140.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp140 = double;
+{$else FPC_COMP_IS_INT64}
+  comp140 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test140(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of char');
+  end;
+
+procedure test140(a: char); overload;
+  begin
+    writeln('char called instead of shortstring');
+    halt(1)
+  end;
+
+var
+  x140: shortstring;
+
+  y140: char;
+procedure dotest140;
+var
+  v: variant;
+
+begin
+  try
+    v := x140;
+    test140(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y140;
+    test140(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest140;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol141.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp141 = double;
+{$else FPC_COMP_IS_INT64}
+  comp141 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test141(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of boolean');
+    halt(1)
+  end;
+
+procedure test141(a: boolean); overload;
+  begin
+    writeln('boolean called instead of shortstring');
+  end;
+
+var
+  x141: shortstring;
+
+  y141: boolean;
+procedure dotest141;
+var
+  v: variant;
+
+begin
+  try
+    v := x141;
+    test141(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y141;
+    test141(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest141;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol142.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp142 = double;
+{$else FPC_COMP_IS_INT64}
+  comp142 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test142(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of widestring');
+  end;
+
+procedure test142(a: widestring); overload;
+  begin
+    writeln('widestring called instead of shortstring');
+    halt(1)
+  end;
+
+var
+  x142: shortstring;
+
+  y142: widestring;
+procedure dotest142;
+var
+  v: variant;
+
+begin
+  try
+    v := x142;
+    test142(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y142;
+    test142(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest142;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol143.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp143 = double;
+{$else FPC_COMP_IS_INT64}
+  comp143 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test143(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of widechar');
+  end;
+
+procedure test143(a: widechar); overload;
+  begin
+    writeln('widechar called instead of shortstring');
+    halt(1)
+  end;
+
+var
+  x143: shortstring;
+
+  y143: widechar;
+procedure dotest143;
+var
+  v: variant;
+
+begin
+  try
+    v := x143;
+    test143(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y143;
+    test143(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest143;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol144.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp144 = double;
+{$else FPC_COMP_IS_INT64}
+  comp144 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test144(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of single');
+    halt(1)
+  end;
+
+procedure test144(a: single); overload;
+  begin
+    writeln('single called instead of ansistring');
+  end;
+
+var
+  x144: ansistring;
+
+  y144: single;
+procedure dotest144;
+var
+  v: variant;
+
+begin
+  try
+    v := x144;
+    test144(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y144;
+    test144(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest144;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol145.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp145 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp145 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test145(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of double');
+    halt(1)
+  end;
+
+procedure test145(a: double); overload;
+  begin
+    writeln('double called instead of ansistring');
+  end;
+
+var
+  x145: ansistring;
+
+  y145: double;
+procedure dotest145;
+var
+  v: variant;
+
+begin
+  try
+    v := x145;
+    test145(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y145;
+    test145(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest145;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol146.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp146 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp146 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test146(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of extended');
+    halt(1)
+  end;
+
+procedure test146(a: extended); overload;
+  begin
+    writeln('extended called instead of ansistring');
+  end;
+
+var
+  x146: ansistring;
+
+  y146: extended;
+procedure dotest146;
+var
+  v: variant;
+
+begin
+  try
+    v := x146;
+    test146(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y146;
+    test146(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest146;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol147.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp147 = double;
+{$else FPC_COMP_IS_INT64}
+  comp147 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test147(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of char');
+  end;
+
+procedure test147(a: char); overload;
+  begin
+    writeln('char called instead of ansistring');
+    halt(1)
+  end;
+
+var
+  x147: ansistring;
+
+  y147: char;
+procedure dotest147;
+var
+  v: variant;
+
+begin
+  try
+    v := x147;
+    test147(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y147;
+    test147(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest147;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol148.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp148 = double;
+{$else FPC_COMP_IS_INT64}
+  comp148 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test148(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of boolean');
+    halt(1)
+  end;
+
+procedure test148(a: boolean); overload;
+  begin
+    writeln('boolean called instead of ansistring');
+  end;
+
+var
+  x148: ansistring;
+
+  y148: boolean;
+procedure dotest148;
+var
+  v: variant;
+
+begin
+  try
+    v := x148;
+    test148(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y148;
+    test148(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest148;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol149.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp149 = double;
+{$else FPC_COMP_IS_INT64}
+  comp149 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test149(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of widestring');
+  end;
+
+procedure test149(a: widestring); overload;
+  begin
+    writeln('widestring called instead of ansistring');
+    halt(1)
+  end;
+
+var
+  x149: ansistring;
+
+  y149: widestring;
+procedure dotest149;
+var
+  v: variant;
+
+begin
+  try
+    v := x149;
+    test149(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y149;
+    test149(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest149;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol15.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp15 = double;
+{$else FPC_COMP_IS_INT64}
+  comp15 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test15(var a); overload;
+  begin
+    writeln('formal called instead of char');
+  end;
+
+procedure test15(a: char); overload;
+  begin
+    writeln('char called instead of formal');
+    halt(1)
+  end;
+
+var
+  x15: longint;
+
+  y15: char;
+procedure dotest15;
+var
+  v: variant;
+
+begin
+  try
+    v := x15;
+    test15(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y15;
+    test15(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest15;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol150.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp150 = double;
+{$else FPC_COMP_IS_INT64}
+  comp150 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test150(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of widechar');
+  end;
+
+procedure test150(a: widechar); overload;
+  begin
+    writeln('widechar called instead of ansistring');
+    halt(1)
+  end;
+
+var
+  x150: ansistring;
+
+  y150: widechar;
+procedure dotest150;
+var
+  v: variant;
+
+begin
+  try
+    v := x150;
+    test150(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y150;
+    test150(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest150;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol151.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp151 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp151 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test151(a: single); overload;
+  begin
+    writeln('single called instead of double');
+  end;
+
+procedure test151(a: double); overload;
+  begin
+    writeln('double called instead of single');
+    halt(1)
+  end;
+
+var
+  x151: single;
+
+  y151: double;
+procedure dotest151;
+var
+  v: variant;
+
+begin
+  try
+    v := x151;
+    test151(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y151;
+    test151(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest151;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol152.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp152 = currency;
+{$else FPC_COMP_IS_INT64}
+  comp152 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test152(a: single); overload;
+  begin
+    writeln('single called instead of extended');
+  end;
+
+procedure test152(a: extended); overload;
+  begin
+    writeln('extended called instead of single');
+    halt(1)
+  end;
+
+var
+  x152: single;
+
+  y152: extended;
+procedure dotest152;
+var
+  v: variant;
+
+begin
+  try
+    v := x152;
+    test152(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y152;
+    test152(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest152;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol153.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp153 = double;
+{$else FPC_COMP_IS_INT64}
+  comp153 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test153(a: single); overload;
+  begin
+    writeln('single called instead of char');
+  end;
+
+procedure test153(a: char); overload;
+  begin
+    writeln('char called instead of single');
+    halt(1)
+  end;
+
+var
+  x153: single;
+
+  y153: char;
+procedure dotest153;
+var
+  v: variant;
+
+begin
+  try
+    v := x153;
+    test153(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y153;
+    test153(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest153;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol155.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp155 = double;
+{$else FPC_COMP_IS_INT64}
+  comp155 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test155(a: single); overload;
+  begin
+    writeln('single called instead of widestring');
+  end;
+
+procedure test155(a: widestring); overload;
+  begin
+    writeln('widestring called instead of single');
+    halt(1)
+  end;
+
+var
+  x155: single;
+
+  y155: widestring;
+procedure dotest155;
+var
+  v: variant;
+
+begin
+  try
+    v := x155;
+    test155(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y155;
+    test155(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest155;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol156.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp156 = double;
+{$else FPC_COMP_IS_INT64}
+  comp156 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test156(a: single); overload;
+  begin
+    writeln('single called instead of widechar');
+  end;
+
+procedure test156(a: widechar); overload;
+  begin
+    writeln('widechar called instead of single');
+    halt(1)
+  end;
+
+var
+  x156: single;
+
+  y156: widechar;
+procedure dotest156;
+var
+  v: variant;
+
+begin
+  try
+    v := x156;
+    test156(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y156;
+    test156(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest156;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol158.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp158 = double;
+{$else FPC_COMP_IS_INT64}
+  comp158 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test158(a: double); overload;
+  begin
+    writeln('double called instead of char');
+  end;
+
+procedure test158(a: char); overload;
+  begin
+    writeln('char called instead of double');
+    halt(1)
+  end;
+
+var
+  x158: double;
+
+  y158: char;
+procedure dotest158;
+var
+  v: variant;
+
+begin
+  try
+    v := x158;
+    test158(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y158;
+    test158(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest158;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol160.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp160 = double;
+{$else FPC_COMP_IS_INT64}
+  comp160 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test160(a: double); overload;
+  begin
+    writeln('double called instead of widestring');
+  end;
+
+procedure test160(a: widestring); overload;
+  begin
+    writeln('widestring called instead of double');
+    halt(1)
+  end;
+
+var
+  x160: double;
+
+  y160: widestring;
+procedure dotest160;
+var
+  v: variant;
+
+begin
+  try
+    v := x160;
+    test160(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y160;
+    test160(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest160;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol161.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp161 = double;
+{$else FPC_COMP_IS_INT64}
+  comp161 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test161(a: double); overload;
+  begin
+    writeln('double called instead of widechar');
+  end;
+
+procedure test161(a: widechar); overload;
+  begin
+    writeln('widechar called instead of double');
+    halt(1)
+  end;
+
+var
+  x161: double;
+
+  y161: widechar;
+procedure dotest161;
+var
+  v: variant;
+
+begin
+  try
+    v := x161;
+    test161(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y161;
+    test161(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest161;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol162.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp162 = double;
+{$else FPC_COMP_IS_INT64}
+  comp162 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test162(a: extended); overload;
+  begin
+    writeln('extended called instead of char');
+  end;
+
+procedure test162(a: char); overload;
+  begin
+    writeln('char called instead of extended');
+    halt(1)
+  end;
+
+var
+  x162: extended;
+
+  y162: char;
+procedure dotest162;
+var
+  v: variant;
+
+begin
+  try
+    v := x162;
+    test162(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y162;
+    test162(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest162;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol164.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp164 = double;
+{$else FPC_COMP_IS_INT64}
+  comp164 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test164(a: extended); overload;
+  begin
+    writeln('extended called instead of widestring');
+  end;
+
+procedure test164(a: widestring); overload;
+  begin
+    writeln('widestring called instead of extended');
+    halt(1)
+  end;
+
+var
+  x164: extended;
+
+  y164: widestring;
+procedure dotest164;
+var
+  v: variant;
+
+begin
+  try
+    v := x164;
+    test164(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y164;
+    test164(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest164;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol165.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp165 = double;
+{$else FPC_COMP_IS_INT64}
+  comp165 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test165(a: extended); overload;
+  begin
+    writeln('extended called instead of widechar');
+  end;
+
+procedure test165(a: widechar); overload;
+  begin
+    writeln('widechar called instead of extended');
+    halt(1)
+  end;
+
+var
+  x165: extended;
+
+  y165: widechar;
+procedure dotest165;
+var
+  v: variant;
+
+begin
+  try
+    v := x165;
+    test165(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y165;
+    test165(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest165;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol166.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp166 = double;
+{$else FPC_COMP_IS_INT64}
+  comp166 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test166(a: char); overload;
+  begin
+    writeln('char called instead of boolean');
+    halt(1)
+  end;
+
+procedure test166(a: boolean); overload;
+  begin
+    writeln('boolean called instead of char');
+  end;
+
+var
+  x166: char;
+
+  y166: boolean;
+procedure dotest166;
+var
+  v: variant;
+
+begin
+  try
+    v := x166;
+    test166(v);
+  except
+    on E : TObject do
+      writeln('QQQ');
+  end;
+
+  try
+    v := y166;
+    test166(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest166;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol167.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp167 = double;
+{$else FPC_COMP_IS_INT64}
+  comp167 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test167(a: char); overload;
+  begin
+    writeln('char called instead of widestring');
+    halt(1)
+  end;
+
+procedure test167(a: widestring); overload;
+  begin
+    writeln('widestring called instead of char');
+  end;
+
+var
+  x167: char;
+
+  y167: widestring;
+procedure dotest167;
+var
+  v: variant;
+
+begin
+  try
+    v := x167;
+    test167(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y167;
+    test167(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest167;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol169.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp169 = double;
+{$else FPC_COMP_IS_INT64}
+  comp169 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test169(a: boolean); overload;
+  begin
+    writeln('boolean called instead of widestring');
+  end;
+
+procedure test169(a: widestring); overload;
+  begin
+    writeln('widestring called instead of boolean');
+    halt(1)
+  end;
+
+var
+  x169: boolean;
+
+  y169: widestring;
+procedure dotest169;
+var
+  v: variant;
+
+begin
+  try
+    v := x169;
+    test169(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y169;
+    test169(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest169;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol17.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp17 = double;
+{$else FPC_COMP_IS_INT64}
+  comp17 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test17(var a); overload;
+  begin
+    writeln('formal called instead of widestring');
+  end;
+
+procedure test17(a: widestring); overload;
+  begin
+    writeln('widestring called instead of formal');
+    halt(1)
+  end;
+
+var
+  x17: longint;
+
+  y17: widestring;
+procedure dotest17;
+var
+  v: variant;
+
+begin
+  try
+    v := x17;
+    test17(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y17;
+    test17(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest17;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol170.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp170 = double;
+{$else FPC_COMP_IS_INT64}
+  comp170 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test170(a: boolean); overload;
+  begin
+    writeln('boolean called instead of widechar');
+  end;
+
+procedure test170(a: widechar); overload;
+  begin
+    writeln('widechar called instead of boolean');
+    halt(1)
+  end;
+
+var
+  x170: boolean;
+
+  y170: widechar;
+procedure dotest170;
+var
+  v: variant;
+
+begin
+  try
+    v := x170;
+    test170(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y170;
+    test170(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest170;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol171.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp171 = double;
+{$else FPC_COMP_IS_INT64}
+  comp171 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test171(a: widestring); overload;
+  begin
+    writeln('widestring called instead of widechar');
+  end;
+
+procedure test171(a: widechar); overload;
+  begin
+    writeln('widechar called instead of widestring');
+    halt(1)
+  end;
+
+var
+  x171: widestring;
+
+  y171: widechar;
+procedure dotest171;
+var
+  v: variant;
+
+begin
+  try
+    v := x171;
+    test171(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y171;
+    test171(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest171;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol18.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp18 = double;
+{$else FPC_COMP_IS_INT64}
+  comp18 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test18(var a); overload;
+  begin
+    writeln('formal called instead of widechar');
+  end;
+
+procedure test18(a: widechar); overload;
+  begin
+    writeln('widechar called instead of formal');
+    halt(1)
+  end;
+
+var
+  x18: longint;
+
+  y18: widechar;
+procedure dotest18;
+var
+  v: variant;
+
+begin
+  try
+    v := x18;
+    test18(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y18;
+    test18(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest18;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol19.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp19 = double;
+{$else FPC_COMP_IS_INT64}
+  comp19 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test19(a: comp19); overload;
+  begin
+    writeln('comp19 called instead of int64');
+  end;
+
+procedure test19(a: int64); overload;
+  begin
+    writeln('int64 called instead of comp19');
+    halt(1)
+  end;
+
+var
+  x19: comp19;
+
+  y19: int64;
+procedure dotest19;
+var
+  v: variant;
+
+begin
+  try
+    v := x19;
+    test19(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y19;
+    test19(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest19;
+end. {$endif not bigfile}

+ 24 - 12
tests/test/cg/variants/tvarol2.pp → tests/test/cg/variants/ivarol2.pp

@@ -1,42 +1,54 @@
+{$ifndef bigfile}
 {$ifdef fpc}
 {$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
 {$endif fpc}
+{$endif bigfile}
 
-{$ifdef FPC_COMP_IS_INT64}
 type 
-  comp = double;
+{$ifdef FPC_COMP_IS_INT64}
+  comp2 = double;
+{$else FPC_COMP_IS_INT64}
+  comp2 = comp;
 {$endif FPC_COMP_IS_INT64}
-procedure test(var a); overload;
+procedure test2(var a); overload;
   begin
     writeln('formal called instead of int64');
-    writeln('XXX')
   end;
 
-procedure test(a: int64); overload;
+procedure test2(a: int64); overload;
   begin
     writeln('int64 called instead of formal');
     halt(1)
   end;
 
+var
+  x2: longint;
+
+  y2: int64;
+procedure dotest2;
 var
   v: variant;
-  x: longint;
-  y: int64;
 
 begin
   try
-    v := x;
-    test(v);
+    v := x2;
+    test2(v);
   except
     on E : TObject do
       halt(1);
   end;
 
   try
-    v := y;
-    test(v);
+    v := y2;
+    test2(v);
   except
     on E : TObject do
       halt(1);
   end;
-end.
+end;
+
+{$ifndef bigfile} begin
+  dotest2;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol21.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp21 = double;
+{$else FPC_COMP_IS_INT64}
+  comp21 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test21(a: comp21); overload;
+  begin
+    writeln('comp21 called instead of longint');
+    halt(1)
+  end;
+
+procedure test21(a: longint); overload;
+  begin
+    writeln('longint called instead of comp21');
+  end;
+
+var
+  x21: comp21;
+
+  y21: longint;
+procedure dotest21;
+var
+  v: variant;
+
+begin
+  try
+    v := x21;
+    test21(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y21;
+    test21(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest21;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol22.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp22 = double;
+{$else FPC_COMP_IS_INT64}
+  comp22 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test22(a: comp22); overload;
+  begin
+    writeln('comp22 called instead of cardinal');
+    halt(1)
+  end;
+
+procedure test22(a: cardinal); overload;
+  begin
+    writeln('cardinal called instead of comp22');
+  end;
+
+var
+  x22: comp22;
+
+  y22: cardinal;
+procedure dotest22;
+var
+  v: variant;
+
+begin
+  try
+    v := x22;
+    test22(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y22;
+    test22(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest22;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol23.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp23 = double;
+{$else FPC_COMP_IS_INT64}
+  comp23 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test23(a: comp23); overload;
+  begin
+    writeln('comp23 called instead of word');
+    halt(1)
+  end;
+
+procedure test23(a: word); overload;
+  begin
+    writeln('word called instead of comp23');
+  end;
+
+var
+  x23: comp23;
+
+  y23: word;
+procedure dotest23;
+var
+  v: variant;
+
+begin
+  try
+    v := x23;
+    test23(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y23;
+    test23(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest23;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol24.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp24 = double;
+{$else FPC_COMP_IS_INT64}
+  comp24 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test24(a: comp24); overload;
+  begin
+    writeln('comp24 called instead of smallint');
+    halt(1)
+  end;
+
+procedure test24(a: smallint); overload;
+  begin
+    writeln('smallint called instead of comp24');
+  end;
+
+var
+  x24: comp24;
+
+  y24: smallint;
+procedure dotest24;
+var
+  v: variant;
+
+begin
+  try
+    v := x24;
+    test24(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y24;
+    test24(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest24;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol25.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp25 = double;
+{$else FPC_COMP_IS_INT64}
+  comp25 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test25(a: comp25); overload;
+  begin
+    writeln('comp25 called instead of byte');
+    halt(1)
+  end;
+
+procedure test25(a: byte); overload;
+  begin
+    writeln('byte called instead of comp25');
+  end;
+
+var
+  x25: comp25;
+
+  y25: byte;
+procedure dotest25;
+var
+  v: variant;
+
+begin
+  try
+    v := x25;
+    test25(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y25;
+    test25(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest25;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol26.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp26 = double;
+{$else FPC_COMP_IS_INT64}
+  comp26 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test26(a: comp26); overload;
+  begin
+    writeln('comp26 called instead of shortint');
+    halt(1)
+  end;
+
+procedure test26(a: shortint); overload;
+  begin
+    writeln('shortint called instead of comp26');
+  end;
+
+var
+  x26: comp26;
+
+  y26: shortint;
+procedure dotest26;
+var
+  v: variant;
+
+begin
+  try
+    v := x26;
+    test26(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y26;
+    test26(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest26;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol27.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp27 = double;
+{$else FPC_COMP_IS_INT64}
+  comp27 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test27(a: comp27); overload;
+  begin
+    writeln('comp27 called instead of shortstring');
+  end;
+
+procedure test27(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of comp27');
+    halt(1)
+  end;
+
+var
+  x27: comp27;
+
+  y27: shortstring;
+procedure dotest27;
+var
+  v: variant;
+
+begin
+  try
+    v := x27;
+    test27(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y27;
+    test27(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest27;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol28.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp28 = double;
+{$else FPC_COMP_IS_INT64}
+  comp28 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test28(a: comp28); overload;
+  begin
+    writeln('comp28 called instead of ansistring');
+  end;
+
+procedure test28(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of comp28');
+    halt(1)
+  end;
+
+var
+  x28: comp28;
+
+  y28: ansistring;
+procedure dotest28;
+var
+  v: variant;
+
+begin
+  try
+    v := x28;
+    test28(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y28;
+    test28(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest28;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol29.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp29 = double;
+{$else FPC_COMP_IS_INT64}
+  comp29 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test29(a: comp29); overload;
+  begin
+    writeln('comp29 called instead of single');
+    halt(1)
+  end;
+
+procedure test29(a: single); overload;
+  begin
+    writeln('single called instead of comp29');
+  end;
+
+var
+  x29: comp29;
+
+  y29: single;
+procedure dotest29;
+var
+  v: variant;
+
+begin
+  try
+    v := x29;
+    test29(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y29;
+    test29(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest29;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol32.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp32 = double;
+{$else FPC_COMP_IS_INT64}
+  comp32 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test32(a: comp32); overload;
+  begin
+    writeln('comp32 called instead of char');
+  end;
+
+procedure test32(a: char); overload;
+  begin
+    writeln('char called instead of comp32');
+    halt(1)
+  end;
+
+var
+  x32: comp32;
+
+  y32: char;
+procedure dotest32;
+var
+  v: variant;
+
+begin
+  try
+    v := x32;
+    test32(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y32;
+    test32(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest32;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol34.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp34 = double;
+{$else FPC_COMP_IS_INT64}
+  comp34 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test34(a: comp34); overload;
+  begin
+    writeln('comp34 called instead of widestring');
+  end;
+
+procedure test34(a: widestring); overload;
+  begin
+    writeln('widestring called instead of comp34');
+    halt(1)
+  end;
+
+var
+  x34: comp34;
+
+  y34: widestring;
+procedure dotest34;
+var
+  v: variant;
+
+begin
+  try
+    v := x34;
+    test34(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y34;
+    test34(v);
+  except
+    on E : TObject do
+      writeln('VVV');
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest34;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol35.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp35 = double;
+{$else FPC_COMP_IS_INT64}
+  comp35 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test35(a: comp35); overload;
+  begin
+    writeln('comp35 called instead of widechar');
+  end;
+
+procedure test35(a: widechar); overload;
+  begin
+    writeln('widechar called instead of comp35');
+    halt(1)
+  end;
+
+var
+  x35: comp35;
+
+  y35: widechar;
+procedure dotest35;
+var
+  v: variant;
+
+begin
+  try
+    v := x35;
+    test35(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y35;
+    test35(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest35;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol36.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp36 = double;
+{$else FPC_COMP_IS_INT64}
+  comp36 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test36(a: int64); overload;
+  begin
+    writeln('int64 called instead of currency');
+    halt(1)
+  end;
+
+procedure test36(a: currency); overload;
+  begin
+    writeln('currency called instead of int64');
+  end;
+
+var
+  x36: int64;
+
+  y36: currency;
+procedure dotest36;
+var
+  v: variant;
+
+begin
+  try
+    v := x36;
+    test36(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y36;
+    test36(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest36;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol37.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp37 = double;
+{$else FPC_COMP_IS_INT64}
+  comp37 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test37(a: int64); overload;
+  begin
+    writeln('int64 called instead of longint');
+    halt(1)
+  end;
+
+procedure test37(a: longint); overload;
+  begin
+    writeln('longint called instead of int64');
+  end;
+
+var
+  x37: int64;
+
+  y37: longint;
+procedure dotest37;
+var
+  v: variant;
+
+begin
+  try
+    v := x37;
+    test37(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y37;
+    test37(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest37;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol38.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp38 = double;
+{$else FPC_COMP_IS_INT64}
+  comp38 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test38(a: int64); overload;
+  begin
+    writeln('int64 called instead of cardinal');
+    halt(1)
+  end;
+
+procedure test38(a: cardinal); overload;
+  begin
+    writeln('cardinal called instead of int64');
+  end;
+
+var
+  x38: int64;
+
+  y38: cardinal;
+procedure dotest38;
+var
+  v: variant;
+
+begin
+  try
+    v := x38;
+    test38(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y38;
+    test38(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest38;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol39.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp39 = double;
+{$else FPC_COMP_IS_INT64}
+  comp39 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test39(a: int64); overload;
+  begin
+    writeln('int64 called instead of word');
+    halt(1)
+  end;
+
+procedure test39(a: word); overload;
+  begin
+    writeln('word called instead of int64');
+  end;
+
+var
+  x39: int64;
+
+  y39: word;
+procedure dotest39;
+var
+  v: variant;
+
+begin
+  try
+    v := x39;
+    test39(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y39;
+    test39(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest39;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol40.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp40 = double;
+{$else FPC_COMP_IS_INT64}
+  comp40 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test40(a: int64); overload;
+  begin
+    writeln('int64 called instead of smallint');
+    halt(1)
+  end;
+
+procedure test40(a: smallint); overload;
+  begin
+    writeln('smallint called instead of int64');
+  end;
+
+var
+  x40: int64;
+
+  y40: smallint;
+procedure dotest40;
+var
+  v: variant;
+
+begin
+  try
+    v := x40;
+    test40(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y40;
+    test40(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest40;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol41.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp41 = double;
+{$else FPC_COMP_IS_INT64}
+  comp41 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test41(a: int64); overload;
+  begin
+    writeln('int64 called instead of byte');
+    halt(1)
+  end;
+
+procedure test41(a: byte); overload;
+  begin
+    writeln('byte called instead of int64');
+  end;
+
+var
+  x41: int64;
+
+  y41: byte;
+procedure dotest41;
+var
+  v: variant;
+
+begin
+  try
+    v := x41;
+    test41(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y41;
+    test41(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest41;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol42.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp42 = double;
+{$else FPC_COMP_IS_INT64}
+  comp42 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test42(a: int64); overload;
+  begin
+    writeln('int64 called instead of shortint');
+    halt(1)
+  end;
+
+procedure test42(a: shortint); overload;
+  begin
+    writeln('shortint called instead of int64');
+  end;
+
+var
+  x42: int64;
+
+  y42: shortint;
+procedure dotest42;
+var
+  v: variant;
+
+begin
+  try
+    v := x42;
+    test42(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y42;
+    test42(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest42;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol43.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp43 = double;
+{$else FPC_COMP_IS_INT64}
+  comp43 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test43(a: int64); overload;
+  begin
+    writeln('int64 called instead of shortstring');
+    halt(1)
+  end;
+
+procedure test43(a: shortstring); overload;
+  begin
+    writeln('shortstring called instead of int64');
+  end;
+
+var
+  x43: int64;
+
+  y43: shortstring;
+procedure dotest43;
+var
+  v: variant;
+
+begin
+  try
+    v := x43;
+    test43(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y43;
+    test43(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest43;
+end. {$endif not bigfile}

+ 54 - 0
tests/test/cg/variants/ivarol44.pp

@@ -0,0 +1,54 @@
+{$ifndef bigfile}
+{$ifdef fpc}
+{$mode delphi}
+{$else fpc}
+{$define FPC_HAS_TYPE_EXTENDED}
+{$endif fpc}
+{$endif bigfile}
+
+type 
+{$ifdef FPC_COMP_IS_INT64}
+  comp44 = double;
+{$else FPC_COMP_IS_INT64}
+  comp44 = comp;
+{$endif FPC_COMP_IS_INT64}
+procedure test44(a: int64); overload;
+  begin
+    writeln('int64 called instead of ansistring');
+    halt(1)
+  end;
+
+procedure test44(a: ansistring); overload;
+  begin
+    writeln('ansistring called instead of int64');
+  end;
+
+var
+  x44: int64;
+
+  y44: ansistring;
+procedure dotest44;
+var
+  v: variant;
+
+begin
+  try
+    v := x44;
+    test44(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+
+  try
+    v := y44;
+    test44(v);
+  except
+    on E : TObject do
+      halt(1);
+  end;
+end;
+
+{$ifndef bigfile} begin
+  dotest44;
+end. {$endif not bigfile}

Some files were not shown because too many files changed in this diff