Commit Graph

2470 Commits

Author SHA1 Message Date
florian
48fbd569fd * support for the CDQE instruction, by Emelyanov Roman, resolves #30978
git-svn-id: trunk@34982 -
2016-11-27 12:42:22 +00:00
sergei
8f4f40d240 * Disabled running the test, because it needs SSE4.1 capable CPU to run, and there is no portable way to detect it.
The purpose of test is compiling MOVSS instruction without warnings, so it still fulfills its task.

git-svn-id: trunk@34950 -
2016-11-22 10:35:41 +00:00
Jonas Maebe
acaae2bf3c * fixed test so it does not use uninitialised floating point values (that
could trigger exceptions)

git-svn-id: trunk@34947 -
2016-11-21 07:39:17 +00:00
sergei
ebe134febc * Fixed memory reference size for MOVSS instruction, Mantis #29954.
git-svn-id: trunk@34943 -
2016-11-21 03:31:25 +00:00
Jonas Maebe
a89a4d905f + test for already fixed mantis #30948
git-svn-id: trunk@34928 -
2016-11-20 11:44:25 +00:00
sergei
edf943a4f6 * Changed memory operand size for VMOVSS instruction to 32 bits, Mantis #29957.
git-svn-id: trunk@34918 -
2016-11-18 23:37:01 +00:00
florian
56252d59f0 + support for the PREFETCHTW1 instruction based on a patch by Emelyanov Roman, resolves #30933
git-svn-id: trunk@34917 -
2016-11-18 20:19:39 +00:00
svenbarth
63b0024e4c * fix for Mantis #30626: unset current_procinfo so that further specializations don't use a symtable to specialize themselves in that they shouldn't use (cause current_procinfo takes precedence)
git-svn-id: trunk@34916 -
2016-11-18 16:17:09 +00:00
svenbarth
0e7a9ad375 * partial fix for Mantis #30831 (partial, because no exception has been encountered yet): when checking whether the left node of a vmtaddrnode is a generic, don't rely on df_generic, but instead use is_generic which checks for a true generic (the other will also be true if it's merely a structured type declared (or specialized) inside another generic)
+ added test

git-svn-id: trunk@34915 -
2016-11-18 14:43:45 +00:00
svenbarth
fc5ce63134 * fix for Mantis #30832: instead of checking a procdef's struct for df_generic check the procdef itself, this way global generic methods or generic methods that are part of non-generic classes or records are caught as well.
+ added test

git-svn-id: trunk@34914 -
2016-11-18 14:01:03 +00:00
florian
67570a6262 + patch to support assigning class procedures to procedure variables by Ondrej Pokorny, resolves #30936
+ additional tests

git-svn-id: trunk@34909 -
2016-11-17 19:40:42 +00:00
pierre
a4f361ad50 Fix error in header line used by dotest, use %target instead of %os
git-svn-id: trunk@34906 -
2016-11-16 09:29:21 +00:00
florian
3f072b3e29 * workaround for issue #30348, FPC allowes now 65535 sections in coff object files, but as the section index is normally signed, this is only a dirty workaround
git-svn-id: trunk@34904 -
2016-11-15 22:06:00 +00:00
sergei
b4904deea8 * MIPS: Fixed code generation for PIC global symbols with large offset, resolves #30552.
git-svn-id: trunk@34902 -
2016-11-15 20:04:27 +00:00
florian
6d6a45c034 * add/sub nodes with nf_internal set should not do overflow checking, resolves #30889
* do not convert succ/pred into add/sub nodes if nf_internal is set

git-svn-id: trunk@34896 -
2016-11-13 21:18:39 +00:00
florian
9bff3ac624 * copy also pushedparasize when copying call nodes, resolves #30923
git-svn-id: trunk@34885 -
2016-11-13 14:46:55 +00:00
florian
96858dd64d + additional tests which ensure that constant propagation is off
as the compiler optimizes the original tests too much with constant propagation
  to keep them useful

git-svn-id: trunk@34796 -
2016-11-05 23:05:57 +00:00
florian
8bbd2e4030 + test for issue #27744
git-svn-id: trunk@34790 -
2016-11-05 23:05:46 +00:00
svenbarth
d4e573c1e3 * fix for Mantis #27349: nested classes might also reside inside records
+ added test

git-svn-id: trunk@34714 -
2016-10-13 20:40:47 +00:00
Jonas Maebe
5efb32285a * fixed alignment for interface RTTI (patch by Alfred, mantis #30182)
git-svn-id: trunk@34695 -
2016-10-09 12:34:01 +00:00
Jonas Maebe
233622157c * don't attempt to load the VMT of a niln when taking the address of a
class method (mantis #30706)

git-svn-id: trunk@34641 -
2016-10-07 16:41:32 +00:00
Jonas Maebe
a3afefc6cb + test for mantis #27522 (fixed in r29811)
git-svn-id: trunk@34601 -
2016-10-02 21:51:31 +00:00
Jonas Maebe
868370d727 + InterlockedCompareExchangePointer() alias for InterlockedCompareExchange(pointer)
(mantis #29964)

git-svn-id: trunk@34599 -
2016-10-02 12:57:07 +00:00
Jonas Maebe
94d7a7274b * compare floating point default parameter values bytewise instead of as
floating point values, so that NaNs can also be compared (mantis #30299)

git-svn-id: trunk@34597 -
2016-10-02 12:56:49 +00:00
Jonas Maebe
de60bfab9c * make the string data of pchar constants read-only (mantis #30666)
git-svn-id: trunk@34594 -
2016-10-02 12:56:40 +00:00
Jonas Maebe
ec53fdf45a * don't try to write using standard I/O from a thread while the program is
shutting down, that can fail
   o the test will still fail because the tthread shutdown code itself in
     the classes unit cannot handle running while a program is quitting,
     and that should be fixed (exposed by r34456)

git-svn-id: trunk@34554 -
2016-09-22 07:50:08 +00:00
svenbarth
ce18b10c81 * fix for Mantis #30530: when the global/static symtable is reached defowner is Nil, so respect that in the loop condition
+ added test

git-svn-id: trunk@34532 -
2016-09-16 15:39:03 +00:00
svenbarth
50f2aab0ef * fix for Mantis #22192: handle the case that a specialization has the same name as the generic it's based on as in that case the typedef of the symbol is an errordef; therefor we need to use the symbol's real name
+ added test

git-svn-id: trunk@34530 -
2016-09-16 15:13:27 +00:00
svenbarth
2ea587f746 * fix for Mantis #30537: also allow the parasymtable as a parent symtable when generating the mangled name as that is needed for generic functions
+ added test

git-svn-id: trunk@34527 -
2016-09-16 14:10:53 +00:00
svenbarth
0500c678e5 * fix for Mantis #30534: don't consider all types with generic constraints as equal, but at least ensure that they have the same basetype (Note: this still needs a bit more improvement)
+ added test

git-svn-id: trunk@34526 -
2016-09-16 13:24:28 +00:00
Jonas Maebe
98020a9b57 * fixed test compilation
git-svn-id: trunk@34508 -
2016-09-11 09:42:15 +00:00
Jonas Maebe
d19bf787a0 * added -gh option required to test correctness
git-svn-id: trunk@34491 -
2016-09-10 18:28:10 +00:00
michael
e3076da0a1 * Testcase for bug #30310
git-svn-id: trunk@34488 -
2016-09-10 18:07:07 +00:00
Jonas Maebe
1e506ce1d5 * call beforedestruction if an exception happens in afterconstruction
(mantis #30570)

git-svn-id: trunk@34453 -
2016-09-08 14:18:59 +00:00
Jonas Maebe
5ffd06392d * don't optimize "x:=f(x)" whereby the function result of f() is passed
by reference in case x is a temp (mantis #30572)

git-svn-id: trunk@34445 -
2016-09-07 19:37:35 +00:00
Jonas Maebe
f64556c125 * when taking the address of a class method via an instance, create a procvar
with the VMT of the instance as self instead of the self instance pointer
    (mantis #29491)

git-svn-id: trunk@34395 -
2016-08-30 07:25:16 +00:00
Jonas Maebe
3669419bb3 * fixed tcasenode.simplify() in case we have to pass via a "less" branch of
of a tcaselabel that also has a valid "greater" branch to arrive at the
    correct entry (mantis #30522)

git-svn-id: trunk@34379 -
2016-08-26 13:02:10 +00:00
marco
690f784c4d * enable 40+ tests for Haiku as per mantis #30470
git-svn-id: trunk@34312 -
2016-08-14 14:09:24 +00:00
Jonas Maebe
20cbdf75ea + test for mantis #24189 (already works in trunk, still broken in 3.0)
git-svn-id: trunk@34290 -
2016-08-12 13:40:19 +00:00
Jonas Maebe
8e0ee6599c * store parameters to inline routines that are already in a temp into a new
temp if the original temp was marked as ti_const, and the new parameter
    gets modified (mantis #30015)

git-svn-id: trunk@34289 -
2016-08-12 13:35:56 +00:00
Jonas Maebe
b17f90d183 * test for mantis #26402 (already fixed in 3.1.1, still broken in 3.0)
git-svn-id: trunk@34282 -
2016-08-12 13:35:37 +00:00
Jonas Maebe
c752050728 * don't print "parameter not used" hints for abstract methods (mantis #30431)
git-svn-id: trunk@34281 -
2016-08-12 13:35:34 +00:00
pierre
5abbe42115 Add fpwidestring and unicodeducet units for go32v2 OS for wide string tests
git-svn-id: trunk@34259 -
2016-08-10 06:24:20 +00:00
Jonas Maebe
de97285393 * fixed conformsToProtocol() declaration (the protocol is not a changeable
parameter, and it's already declared as a pointer type)

git-svn-id: trunk@34246 -
2016-08-03 14:35:32 +00:00
svenbarth
685f820622 * switch class'/object's parent reference in the VMT to an indirect reference
(this also requires the adjustment of a test)

git-svn-id: trunk@34172 -
2016-07-22 12:53:51 +00:00
pierre
1e58b6d944 Use %skiptarget=$nothread for tests using thread capabilities
git-svn-id: trunk@34105 -
2016-07-13 15:21:23 +00:00
pierre
2b3ef31505 Correct previous commit: %skiptarget needs equal sign
git-svn-id: trunk@34104 -
2016-07-13 15:20:31 +00:00
pierre
f8cdabfadb Skip test tw3157 for go32v2 target as it genrates problems on ntvdm.exe under windows
git-svn-id: trunk@34100 -
2016-07-12 14:43:06 +00:00
svenbarth
54b6cacf36 Fix for Mantis #30357.
Reset tstoredsymtable.init_final_check_done when a symbol is added or removed as otherwise property getters in a record *before* any managed field would trigger it, thus leading to the record being considered as "non-managed".

git-svn-id: trunk@34088 -
2016-07-08 18:20:47 +00:00
pierre
c8b1ca59d5 Fix test for compact and medium i8086 memory model
git-svn-id: trunk@34071 -
2016-07-05 22:11:28 +00:00
Károly Balogh
0e54f616b5 merged i386 int64 mod helper fix by Max Nazhalov (Mantis 30240)
git-svn-id: trunk@34059 -
2016-07-03 21:20:07 +00:00
Jonas Maebe
db77aad2cc * support LOC_MMREGISTER for paralocs when loading 128 bit function results
into integer registers (a record that consists of 4 32 bit floats is
    returned in 2 xmm registers on x86_64) (mantis #30329)

git-svn-id: trunk@34058 -
2016-07-03 21:18:23 +00:00
Jonas Maebe
8df1d1f9b8 * fixed compilation of tw15391 with range checking enabled after r34034:
support maybe_call_procvar() on internal block nodes, which return
    their result via the last statement

git-svn-id: trunk@34051 -
2016-07-02 21:09:59 +00:00
Jonas Maebe
996e325175 * converted range checking for open arrays/array of const from the code
generator to the typecheck pass, so that it also works for platforms
    that use the parentfpstruct way to handle accesses to nested frames
    in case the array has been migrated to such a parentfpstruct
   o additionally, the number of comparisons for such range checks
     has been reduced from 3 (for signed indices) or 2 (for unsigned
     indices) to 1 in all cases
   o the range checking code is disabled for the JVM target, as the
     JVM automatically range checks all array accesses itself anyway

git-svn-id: trunk@34034 -
2016-06-30 15:33:47 +00:00
pierre
544d33bf48 Range and overflow check explicitly disabled
git-svn-id: trunk@34013 -
2016-06-21 08:18:22 +00:00
pierre
40292a476f Expicitly disable range check on old test and add new test with and changes
git-svn-id: trunk@34012 -
2016-06-21 08:14:43 +00:00
pierre
df7e562d94 Add explicit $R- or $Q- to avoid different results if -Criot option is used
git-svn-id: trunk@34010 -
2016-06-20 15:55:10 +00:00
Jonas Maebe
0ed6c3d80e * also use the last floating point parameter register on AArch64 in case of
a HFA type (which in practice also applies to plain floating point types)
    (patch by Alfred, mantis #30207)

git-svn-id: trunk@33922 -
2016-06-05 20:18:24 +00:00
florian
49f63d67b2 * correctly check left.location instead of left.expectloc when generating
code for not nodes, resolves #30208

git-svn-id: trunk@33906 -
2016-06-04 15:54:17 +00:00
svenbarth
8c96fbed8f Fix for Mantis #28832
ninl.pas, tinlinenode:
  * pass_typecheck: let code pass on to simplify() for undefineddefs in Low() and High()
  * simplify: create a constant 0 as fallback

+ added test

git-svn-id: trunk@33884 -
2016-06-03 12:14:30 +00:00
svenbarth
04adcf2a12 Fix for Mantis #30179 and #30203.
pexpr.pas:
  * handle_factor_typenode: rework code for records and objects so that Delphi style specializations are handled as well
  * sub_expr.generate_inline_specialization: also do a typecheck pass on pload to be sure that we have a resultdef

+ added tests

git-svn-id: trunk@33876 -
2016-06-01 20:06:40 +00:00
svenbarth
c3c345d569 Fix for Mantis #30202.
pexpr.pas, sub_expr.generate_inline_specialization:
  * do_member_read() needs to happen independently of whether we're calling a method of the same object (was incorrectly copypasted code... :/ )

+ added test

git-svn-id: trunk@33875 -
2016-06-01 20:03:59 +00:00
florian
57f93ed40d * correctly generate accesses to jump tables if it contains negative entries, resolves issue #30119
git-svn-id: trunk@33760 -
2016-05-22 21:02:49 +00:00
Károly Balogh
963c4aa1f8 * fixed the sign handling of i386 fpc_div_int64 helper (Mantis 30166)
git-svn-id: trunk@33753 -
2016-05-22 16:57:30 +00:00
Jonas Maebe
14bab6c85d * fixed ppc jump table generation in case a jump table has cases for the
lowest and highest element of the type of the case expression, and the
    lowest element <> 0 (mantis #29906)

git-svn-id: trunk@33630 -
2016-05-03 09:00:52 +00:00
Jonas Maebe
eabcabe329 * fixed test in case a widestringmanager is installed
git-svn-id: trunk@33611 -
2016-05-02 08:23:14 +00:00
Jonas Maebe
2bbab60c92 * when simplifying a constant string concatenation that gets assigned to a
rawbytestring, ensure the resulting constant string does not get CP_NONE
    as codepage, but the default system code page (mantis #30082)

git-svn-id: trunk@33597 -
2016-05-01 13:16:02 +00:00
Jonas Maebe
130d9fee91 * don't take the address of element 0 of a dynamic array in
tcallparanode.copy_value_by_ref_para() if the array is empty
    (mantis #30007)

git-svn-id: trunk@33595 -
2016-05-01 12:35:09 +00:00
Jonas Maebe
44682f9f4d * ensure that if we create a temp for the funcretnode in a call node,
the funcretnode field keeps a reference to this temp even after we
    assign it to the call-by-reference return parameter if it is deleted
    by changing it into a normal temp (after which it will be freed when
    the result of the call node is used), because in that case getcopy
    for the callnode must copy this reference after copying the
    tempdeletenode in order to reset tempinfo^.hookoncopy (mantis #29891)

git-svn-id: trunk@33569 -
2016-04-28 20:33:12 +00:00
svenbarth
d07b49270f Fix for Mantis #30030.
pgenutil.pas:
  * parse_generic_specialization_types_internal: ignore the parasymtable of procvars (as before the addition of generic routines) and instead use the type's hierarchy name
  * generate_specialization_phase2: specialize types of procvars into the parameter symtable as they don't have a local one

+ added test

git-svn-id: trunk@33544 -
2016-04-22 13:07:48 +00:00
Jonas Maebe
1850cb4ccc * don't look at the resultdef, but at the defs of the operands to decide
whether a multiplication needs to be signed or unsigned (can be different
    in case of a 32x32->64 multiplication) (mantis #30035)

git-svn-id: trunk@33539 -
2016-04-20 22:17:15 +00:00
Jonas Maebe
2a1f2b9fd9 * fixed a_load_regconst_subsetreg_intern() when loading a 32 bit register
to a non-zero bit offset in a subsetreg (mantis #29933)

git-svn-id: trunk@33498 -
2016-04-13 17:09:31 +00:00
Jonas Maebe
08d63e3408 * allow default parameters for constref (mantis #29992)
git-svn-id: trunk@33480 -
2016-04-10 21:27:29 +00:00
florian
406e3c4ac1 + support xgetbv instruction, resolves issue #29958
git-svn-id: trunk@33418 -
2016-04-03 20:53:10 +00:00
Jonas Maebe
1e1b36515e * don't narrow expressions that contain a mod/div followed by an "and",
since the mod/div get a different result if calculated using fewer
    bits (mantis #29930)

git-svn-id: trunk@33413 -
2016-04-02 22:09:34 +00:00
Jonas Maebe
a5dba44fd3 * fixed sign extension for unaligned loads (mantis #29891, although that
code shouldn't use unaligned loads in the first place)

git-svn-id: trunk@33382 -
2016-03-29 14:52:27 +00:00
Jonas Maebe
322493c195 * fixed overflow checking on AArch64 for signed multiplications with zero
(mantis #29912)

git-svn-id: trunk@33380 -
2016-03-29 09:50:42 +00:00
florian
8d5cc3dfa4 * (extended and modified) patch by Emelyanov Roman to add suport of RDRAND, RDSEED and TSX instructions set, resolves issue #29893.
In comparison with the original patch, support for a i386 has been added as well as a test program. 
  Further, a small issue with xbegin has been fixed

git-svn-id: trunk@33375 -
2016-03-28 19:08:13 +00:00
yury
d4d70d3865 * Evaluate currency constant expressions when the currency type is 64-bit integer. Issue #28749.
git-svn-id: trunk@33334 -
2016-03-26 17:48:50 +00:00
yury
d7cc0064d3 * Disabled test for android.
git-svn-id: trunk@33304 -
2016-03-20 22:09:45 +00:00
yury
3a5412a931 * Disabled tests which force the -Cg- option for Android since they can not be run on Android 5+ where PIE is required.
git-svn-id: trunk@33303 -
2016-03-20 21:52:05 +00:00
svenbarth
e9fab1bfee Fix for Mantis #29080.
psub.pas, tcgprocinfo.parse_body:
  * ensure that parse_generic and current_genericdef are set correctly when parsing a generic routine
pgenutil.pas, generate_specialization_phase2:
  * when we're specializing inside a generic we don't want to have the routine definitions, so let the compiler assume that the routine is no longer a forward definition

+ added test

git-svn-id: trunk@33275 -
2016-03-18 16:31:23 +00:00
florian
bb1f2b8062 * make NativeInt and NativeUInt unique types, resolves #29444
git-svn-id: trunk@33234 -
2016-03-13 15:30:38 +00:00
svenbarth
27ab1c61c5 Fix for Mantis #29745.
symdef.pas, getansistringdef:
  * use a temporary, non-defaware symtablestack to create the ansistringdef

+ added test

git-svn-id: trunk@33214 -
2016-03-10 19:43:45 +00:00
svenbarth
e58488dc3e Fix for Mantis #29792.
htypechk.pas, tcallcandidates:
  * create_candidate_list: check the correct tableoptions for sto_has_overload flag

+ added test

git-svn-id: trunk@33211 -
2016-03-09 20:45:26 +00:00
Jonas Maebe
c93e8a51cd * fixed test result after r33201
git-svn-id: trunk@33204 -
2016-03-07 19:59:05 +00:00
Jonas Maebe
70cd8f6e59 - removed overflow, so the test also works with constant propagation and -Co
git-svn-id: trunk@33201 -
2016-03-07 14:40:52 +00:00
Jonas Maebe
0e97811b50 + initialise managed string function results with an error string when
compiling with -gt (mantis #28948)

git-svn-id: trunk@33198 -
2016-03-06 17:22:11 +00:00
Jonas Maebe
315b32918e + Tconstexprint-version of ispowerof2() to correctly deal with constants
> high(int64) (mantis #29620)

git-svn-id: trunk@33191 -
2016-03-06 14:16:47 +00:00
Jonas Maebe
096e1c45d6 * don't keep records in registers if they contain a field that spans the
boundary between two awords, as our subscript code does not handle
    them correctly (second part of mantis #29669)

git-svn-id: trunk@33180 -
2016-03-06 13:20:25 +00:00
Jonas Maebe
9788bb1316 * fixed check regarding whether a field is in the first or second word of
of 2*sizeof(aword) bitpacked record that's kept in registers
    (mantis #29669)

git-svn-id: trunk@33177 -
2016-03-06 13:20:16 +00:00
Jonas Maebe
4039c1835c + test from mantis #29547, fixed in r30168 as mantis #27580
git-svn-id: trunk@33164 -
2016-03-05 19:01:47 +00:00
Jonas Maebe
a100309350 * made utf8tostring() Delphi-compatible (mantis #29585):
o removed utf8string overload
   o always ignore any code page information from the input, and interpret the
     contents of the input directly as utf8-encoded bytes
 * made utf8tostring() compatible with the JVM backend (mantis #29497)

git-svn-id: trunk@33159 -
2016-03-05 15:32:22 +00:00
svenbarth
25744dd3f1 Fix for Mantis #29609.
pexpr.pas, factor.factor_read_id:
  * don't use a cloadvmtaddrnode for accessing class properties in records

+ added test

git-svn-id: trunk@33110 -
2016-02-19 21:37:02 +00:00
Jonas Maebe
f3df3a7a67 + test for mantis #28668
git-svn-id: trunk@33104 -
2016-02-18 22:03:46 +00:00
Jonas Maebe
001417bb47 + test from mantis #28667
git-svn-id: trunk@33103 -
2016-02-18 21:58:34 +00:00
sergei
2861362780 * Reuse binary search routine from rgbase.pas to look up AT&T register names, removes need in regnumber_count_bsstart constant. Resolves #29471.
git-svn-id: trunk@33076 -
2016-02-09 16:48:32 +00:00
svenbarth
05174f3e67 Fix for Mantis #29546.
htypechk.pas, tcallcandidates:
  * create_candidate_list: don't check whether the pd is a specialization if the owner is valid; happens if a generic method is used more than once (which should happen here and then :P )

+ added test

git-svn-id: trunk@33037 -
2016-01-31 17:14:44 +00:00
svenbarth
d2a7f17d8c Fix for Mantis #29372.
compiler/ncgcal.pas:
  * tchcallnode.release_para_temps: don't release temps of a constructor's self parameter

+ added test

git-svn-id: trunk@32990 -
2016-01-23 22:19:00 +00:00
Jonas Maebe
a65ab73e8b * support unicodestring constants in "case string of" (mantis #29353)
git-svn-id: trunk@32970 -
2016-01-20 21:11:26 +00:00
svenbarth
82788b4995 tw20821.pp:
* test program attached to the bug report was incorrectly transformed to a test for the test suite

git-svn-id: trunk@32962 -
2016-01-17 12:14:54 +00:00
florian
df82921cd8 * fix test after r32820
git-svn-id: trunk@32855 -
2016-01-05 13:46:06 +00:00
florian
a4d2f71d3d * better estimation of compatibility of array constructors with open arrays, resolves issue #29244
git-svn-id: trunk@32846 -
2016-01-04 23:10:45 +00:00
svenbarth
61b12af82b Fix for Mantis #29321.
pexpr.pas, postfixoperators:
  * also handle type helpers for static arrays

+ added test

git-svn-id: trunk@32845 -
2016-01-04 22:02:24 +00:00
florian
a7f1ce2e98 * patch by Dmitry Boyarintsev: initialize dyn. arrays more cleverly in a setlength call with ref. count>1, resolves issue #29250
git-svn-id: trunk@32721 -
2015-12-26 08:53:56 +00:00
Jonas Maebe
0df558af36 * disabled pic
* mark eax as used in assembler block in main program

git-svn-id: trunk@32689 -
2015-12-20 20:56:13 +00:00
Jonas Maebe
b4e857e9c4 * skip for darwin because it always requires/expects a 16 byte aligned stack
* mark ebx as modified in the assembler blocks

git-svn-id: trunk@32688 -
2015-12-20 20:56:11 +00:00
sergei
272e3db1db * Fixed test on x86_64 ('nostackframe' modifier ensures that no prologue/epilogue code is added on fixed-stack targets).
git-svn-id: trunk@32673 -
2015-12-16 16:46:23 +00:00
sergei
31623565cb * Skip test for Win64, since *nix-style PIC is not supported on that system.
git-svn-id: trunk@32672 -
2015-12-16 16:37:41 +00:00
florian
a3964d9ee0 + support for RDTSCP, resolves issue #28916
git-svn-id: trunk@32652 -
2015-12-13 13:28:51 +00:00
Jonas Maebe
092a0af0ec * removed special-purpose code for constant chars while parsing typed string
constants: it did not properly handle ansistring code pages, and was just a
    hack to speed things up a bit (mantis #29153)

git-svn-id: trunk@32636 -
2015-12-11 15:33:28 +00:00
Jonas Maebe
ed03286be5 * simplify "div -1" to unaryminusn, not just for performance reasons but
also because "div -1" is not handled correctly by the div-to-mul/shift
    transformation on x86 (mantis #28702)

git-svn-id: trunk@32619 -
2015-12-08 15:57:07 +00:00
Jonas Maebe
0b4f3f01b3 * fixed another case of endless recursion in
tabstractrecordsymtable.has_single_field(), due to always looking in the
    symlist of the original record rather than properly recursing into those
    of nested ones (mantis #28641)

git-svn-id: trunk@32618 -
2015-12-08 15:35:19 +00:00
Jonas Maebe
01d93b61c3 * save/restore the type (and hence code page) of ansistring constsyms in/from
the ppu (mantis #28964)
  * also save/restore the type of constnil, constresourcestring and constguid
    in/from the ppu

git-svn-id: trunk@32617 -
2015-12-08 14:27:23 +00:00
florian
19a7bc0aee * fix test for 64 bit targets
git-svn-id: trunk@32613 -
2015-12-07 21:48:19 +00:00
florian
cad29a4e19 * set nf_write flag correctly for subscript nodes, resolves issue #28713
git-svn-id: trunk@32602 -
2015-12-06 19:17:50 +00:00
Jonas Maebe
03067f240c + added already working test for mantis #27149
git-svn-id: trunk@32577 -
2015-12-04 14:00:37 +00:00
Jonas Maebe
2e0fea94b8 * set operand size information when accessing fields in assembly
(mantis #29096)

git-svn-id: trunk@32567 -
2015-12-02 15:53:22 +00:00
Jonas Maebe
0c4edd2aa9 * fixed getting address of interface methods after r32414: interfaces are not
a pointer to a vmt, but a pointer to a pointer to vmt (mantis #29086)
   o also adjusted the llvm type for interfaces accordingly

git-svn-id: trunk@32530 -
2015-11-25 19:28:17 +00:00
Jonas Maebe
9ea38f4577 * support static fields in nested types in records, by always including
support for nested types when generating an access to a static fied;
    we also always do that when generating the mangled name of a static
    field declaration in symcreat.make_field_static() (mantis #29030)

git-svn-id: trunk@32517 -
2015-11-24 16:04:19 +00:00
Jonas Maebe
9dc5f1acb4 * support LOC_(C)SUBSETREG in tcgvecnode.pass_generate_code, can also occur
for function results (patch by Do-wan Kim, mantis #29064)

git-svn-id: trunk@32516 -
2015-11-24 15:03:34 +00:00
svenbarth
6ff3226e3c Fix for Mantis #29066.
git-svn-id: trunk@32459 -
2015-11-22 11:17:15 +00:00
svenbarth
318b69600c Fix for Mantis #29065.
+ add an ObjFPC variant of the test for 29053.

git-svn-id: trunk@32453 -
2015-11-22 10:44:03 +00:00
nickysn
79336c59de * fixed test for PIC code on i386
git-svn-id: trunk@32434 -
2015-11-21 15:02:04 +00:00
svenbarth
fcae436177 Add test for Mantis #29053 to make sure it doesn't get broken by accident.
git-svn-id: trunk@32432 -
2015-11-21 14:35:35 +00:00
nickysn
82eb67cd24 * fixed test for PIC code on x86_64
git-svn-id: trunk@32431 -
2015-11-21 14:34:28 +00:00
nickysn
ba66456bdb * properly determine the operand size for inline assembler references to procvar
variables without a manually specified size override such as 'dword ptr'.
  Mantis #29010.

git-svn-id: trunk@32379 -
2015-11-20 16:29:40 +00:00
Jonas Maebe
fd0c2f36e5 * don't parse "flags" as a register name in the Intel assembler reader
(mantis #29040)

git-svn-id: trunk@32368 -
2015-11-19 19:40:06 +00:00
Jonas Maebe
f004227d91 * ignore the name of class con- and destructors (patch by Ondrej Pokorny,
mantis #28801)

git-svn-id: trunk@32223 -
2015-11-03 18:10:08 +00:00
Jonas Maebe
8087389f63 * support assigning static methods to regular procvars in (obj)fpc mode
(patch by Ondrej Pokorny, mantis #27414)

git-svn-id: trunk@32216 -
2015-11-01 18:02:46 +00:00
Jonas Maebe
4decb81ac4 * correctly handle code page names specified in upper case (mantis #28934)
git-svn-id: trunk@32202 -
2015-10-30 15:10:26 +00:00
sergei
be6bcb71dc * Fixed test on 64-bit targets, was always using i386 code due to incorrect CPU selection symbol (must be "cpux86_64", not "x86_64").
git-svn-id: trunk@32087 -
2015-10-18 10:02:21 +00:00
Jonas Maebe
1294dc1ede * when inserting a non-empty ansistring into an empty ansistring, the
destination must get the code page of the source (mantis #28850)

git-svn-id: trunk@32066 -
2015-10-16 19:15:40 +00:00
yury
9431648b6c * Fixed conversion from float to currency when the currency type is 64-bit integer. Issue #28748.
git-svn-id: trunk@32054 -
2015-10-13 22:30:46 +00:00
svenbarth
d4635f10df Remaining fix for Mantis #28674.
ptype.pas, resolve_forward_types:
  * in case of the def of the forward being the same as the genericdef of the def the forwarddef belongs to the typesym needs to be changed to the one of the specialization

tests/webtbs/tw28674.pp:
  * adjusted text

git-svn-id: trunk@31987 -
2015-10-09 13:18:35 +00:00
svenbarth
3afc18f277 Fix for Mantis #28766.
ncgrtti.pas, write_persistent_type_info:
  * do not generate RTTI information for generics

git-svn-id: trunk@31911 -
2015-10-02 13:06:51 +00:00
svenbarth
c25e7491e7 Fix for Mantis #28674.
ptype.pas, resolve_forward_types:
  * fix an access violation in case of inline pointer declarations
  * fix the check whether it's a valid use of a generic (parse_generic is useless here...)

+ added test

git-svn-id: trunk@31910 -
2015-10-02 12:46:13 +00:00
Jonas Maebe
2cf8e50771 * fixed unwanted disabling of a codepage set via -FcXXX/{$codepage XXX}
when {$modeswitch systemcodepage} gets disabled without having been
    enabled first (such as when initially setting the syntax mode)
    (mantis #28718)

git-svn-id: trunk@31831 -
2015-09-25 18:31:58 +00:00
yury
34efa0e9a9 * Skip tests for android since they must be run locally.
git-svn-id: trunk@31727 -
2015-09-16 18:22:00 +00:00
yury
95aa8cf453 * delete test file.
git-svn-id: trunk@31726 -
2015-09-16 18:19:57 +00:00
Jonas Maebe
6ffd8f0201 * finalize managed data passed to untyped "out" parameters after r31328
(mantis #2863)

git-svn-id: trunk@31624 -
2015-09-12 23:31:57 +00:00
svenbarth
2cf8cdd885 Fix for Mantis #28650.
rtl/objpas/sysutils/sysstrh.inc:
  * forward PString to ObjPas.PString to avoid potential type conflicts

+ added test

git-svn-id: trunk@31603 -
2015-09-11 15:38:59 +00:00
Jonas Maebe
85403876cd * fixed UCS4Decode() for #$ffff (patch by Inoussa OUEDRAOGO, mantis #28593)
git-svn-id: trunk@31480 -
2015-09-02 12:10:45 +00:00
svenbarth
66781b5526 Fix for Mantis #28530.
ptype.pas:
  * record_dec: if parse_generic is given set current_genericdef

+ added test

git-svn-id: trunk@31437 -
2015-08-28 15:46:18 +00:00
marco
70df08d5be * patch from #28557 by Oliver, correct libroot for Haiku
git-svn-id: trunk@31361 -
2015-08-22 12:21:46 +00:00
Jonas Maebe
e06181749c * guarantee the order of parameter pushes again after r31201 on platforms
that don't use a fixed stack (mantis #28454)
   o moved the code to finalise managed out parameters from ncgcal to ncal,
     and add it to the init code of the call node (so it's evaluated before
     any parameters are processed, ensuring that mantis #28390 stays fixed)

git-svn-id: trunk@31328 -
2015-08-16 12:47:09 +00:00
svenbarth
39016c032e Fix for Mantis #28442. Do not generate the VMT record definition for generic classes. It isn't used anyway.
nobj.pas, TVMTBuilder:
  * generate_vmt_def: check for df_generic (not is_generic!) and abort if set

+ added test

git-svn-id: trunk@31301 -
2015-08-07 15:02:55 +00:00
florian
9a55e8fa3c * do not call typecheckpass unncessarily in generic definitions, it might cause only errors, resolves #28058
git-svn-id: trunk@31262 -
2015-08-02 20:29:30 +00:00
Jonas Maebe
9118146bc1 * ensure that managed out-parameters are processed before any other
parameters:
   1) since they are finalised on the caller side, if that same value
      is passed as a value parameter as well and its reference count
      was 1, then the value parameter will contain an invalid pointer
   2) since finalisation involves a call, for optimal code generation
      purposes they should also be evaluated first
    (mantis #28279, #28390)

git-svn-id: trunk@31201 -
2015-07-10 22:04:35 +00:00
Jonas Maebe
af2c7bf00f * don't perform CSE on typeconversion nodes inserted for absolute
references, or anything below them (mantis #27210)

git-svn-id: trunk@31193 -
2015-07-04 22:28:31 +00:00
Jonas Maebe
fa1ac2515e * don't look for overloaded operators in case of internally generated
type conversions (mantis #28375)

git-svn-id: trunk@31191 -
2015-07-03 20:19:48 +00:00
Jonas Maebe
ee87d3bba9 * fixed "case <string> of" with multiple labels for a single statement after
r30855 (mantis #28372)

git-svn-id: trunk@31190 -
2015-07-03 20:04:25 +00:00
Jonas Maebe
62784ef902 * copy the vmt_entry node in tcallnode.dogetcopy (mantis #28313)
o mention why it doesn't have to be compared in tcallnode.docompare

git-svn-id: trunk@31071 -
2015-06-16 21:24:55 +00:00
svenbarth
b0fa341006 Fix for Mantis #28271.
rtl/objpas/classes/classes.inc:
  + new variable ExternalThreadsCleanup to keep track whether ExternalThreads list is currently cleared
  * TExternalThread.Create: add the thread instance to the external thread list
  * TExetrnalThread.Destroy: remove the thread instance from the external thread list (if not in system cleanup anyway)
  * CommonCleanup: set ExternalThreadsCleanup to true so that the threads don't remove themselves from the list anymore

+ added test

git-svn-id: trunk@31028 -
2015-06-12 13:39:31 +00:00
Jonas Maebe
00b68dfd9f + test for mantis #16582 (already works with FPC 2.6.4)
git-svn-id: trunk@30909 -
2015-05-25 12:55:44 +00:00
Jonas Maebe
caea5ac8be * record a load node for the self/vmt tree of the current routine in the
tcallnode constructor, so that when it's needed later during pass 1,
    its value doesn't depend on the context in which pass 1 is executed
    (e.g. when inlining) (mantis #18121)

git-svn-id: trunk@30908 -
2015-05-25 12:55:40 +00:00
Jonas Maebe
528b0832c6 * fixed test for Linux/AArch64 (patch by Edmund Grimley Evans)
git-svn-id: trunk@30898 -
2015-05-23 21:04:17 +00:00
Jonas Maebe
9b987fde93 * fmShareDenyNone should also take a shared lock (+ test)
git-svn-id: trunk@30877 -
2015-05-17 11:08:08 +00:00
Jonas Maebe
be6dc49aa5 * fixed test for Windows (the fact that it worked for Unix was due to a bug
in the Unix file locking implementation)

git-svn-id: trunk@30876 -
2015-05-17 11:08:05 +00:00
florian
956883b0c7 * pass dyn. arrays in registers when i386 register calling conventions are used
git-svn-id: trunk@30870 -
2015-05-16 20:27:09 +00:00
Jonas Maebe
3efd54cbd6 * removed interactiveness from the test
git-svn-id: trunk@30862 -
2015-05-15 19:45:18 +00:00
Jonas Maebe
31037d0664 * when creating a file with an exclusive sharing mode on Unix, first check
whether there isn't already a file and of so whether we can open it using
    this exclusive sharing mode (since the locking is advisory, simply
    overwriting any existing file and then locking it exclusively will
    always work) (mantis #27998)

git-svn-id: trunk@30861 -
2015-05-15 19:45:12 +00:00
Jonas Maebe
afd5ed4afe * fixed StrPLCopy() with maxlen=0 (mantis #28089, patch by LacaK)
git-svn-id: trunk@30858 -
2015-05-15 09:00:56 +00:00
Jonas Maebe
678519c9d9 - removed -Ooasmcse
git-svn-id: trunk@30841 -
2015-05-10 13:39:28 +00:00
florian
b222d0b663 * correctly handle LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF in second_int_to_bool, resolves issue #28007
git-svn-id: trunk@30765 -
2015-05-02 13:52:50 +00:00
svenbarth
19c6d72c7b Fix for Mantis #27750.
pgenutil.pas:
  * parse_generic_parameters: create explicit undefineddefs for type parameters that don't have a constraint
  * insert_generic_parameter_types: move the created undefineddefs from the parent symtable to the generic's symtable
defcmp.pas, compare_defs_ext:
  * in case the flag for strict undefineddef checks is set don't consider two different undefineddefs as compatible
+ added tests

git-svn-id: trunk@30705 -
2015-04-24 14:51:22 +00:00
Jonas Maebe
3be51e1455 * fixed endless recursion in tabstractrecorddef.contains_float_field() in
case a record contains an internal typed constant of its own type
    (which happened becuase such a typed constant is also fieldvarsym, solved
     by checking for sp_static) (mantis #27880)
  * fixed several other similar cases in the compiler where we are only
    interested in instance fields, but processed all fieldvarsyms

git-svn-id: trunk@30614 -
2015-04-16 21:25:22 +00:00
Jonas Maebe
e6361c634c * fixed Inc<Time>() with negative TDateTime values (mantis #27832)
git-svn-id: trunk@30608 -
2015-04-15 20:46:28 +00:00
Jonas Maebe
9079227c56 * don't give an internalerror when trying to prefetch a regvar or even
something without a location at all; it's a hint/optional operation,
    so if there's nothing to prefetch just don't do anything
    (mantis #27811)

git-svn-id: trunk@30502 -
2015-04-08 20:35:13 +00:00
Jonas Maebe
201121d7c9 * synchronised with trunk till r30345
git-svn-id: branches/hlcgllvm@30349 -
2015-03-28 12:28:15 +00:00
florian
5f4dc5e54f * parentheses after an @-operator can contain a full expression, resolves #27517
git-svn-id: trunk@30272 -
2015-03-22 13:00:43 +00:00
florian
3396e2e1f4 * interpret -daaa:=bbb after -Sm was passed as a macro definition, resolves #27529
git-svn-id: trunk@30271 -
2015-03-22 10:20:37 +00:00
Jonas Maebe
ea3a306da8 * never say that an automatically added unit is unused (mantis #27691)
git-svn-id: trunk@30261 -
2015-03-19 17:48:57 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
florian
331ace25c6 * handle undefineddef in classify_argument, resolves #27658
git-svn-id: trunk@30239 -
2015-03-15 16:19:58 +00:00
Jonas Maebe
8334597476 * a homogeneous float aggregate can maximally contain 4 elements
(mantis #27665)

git-svn-id: trunk@30229 -
2015-03-14 21:46:45 +00:00
Jonas Maebe
fc21845686 * fixed the allocation of R12 on ppc32/ppc64 when used to hold the value of
the stack pointer during the prolog. This was done previously in
    tcg.g_proc_entry(), but that routine is called after register allocation
    and hence has no influence. Also cleaned up the deallocation of that
    register by moving the previously ifdef'd code to thlcgppcgen
    (mantis #27634)

git-svn-id: trunk@30164 -
2015-03-11 17:49:44 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Tomas Hajny
b2475353f4 * test programs previously having extension .pas renamed to .pp so that they are found during testsuite runs
git-svn-id: trunk@30024 -
2015-02-27 13:03:13 +00:00
Jonas Maebe
e6d948470e * skip test in general for 64 bit cpus
git-svn-id: trunk@29947 -
2015-02-23 22:54:31 +00:00
Jonas Maebe
3f5e95791b * use iosxwstr instead of cwstring on Darwin (for iOS 7+ testing)
git-svn-id: trunk@29829 -
2015-02-23 22:48:15 +00:00
florian
c46cbd3b1a + test for an already fixed report (#14347), added to avoid that it pops up again
git-svn-id: trunk@29793 -
2015-02-22 20:33:01 +00:00
florian
cab98a58d0 + parameters of nested procedure variable parameters are taken into account during name mangling, resolves #27515
* de-duplicated parameter name mangling code

git-svn-id: trunk@29791 -
2015-02-22 09:16:20 +00:00
svenbarth
5a344ee263 Rework the way how "specialize" is handled. Instead of initializing the specialization of a full type declaration (including unit name and parent types) it is now considered part of the specialized type itself. This means that for example the following code:
type
  TTestLongInt = specialize SomeOtherUnit.TTest<LongInt>;

will now have to read as

type
  TTestLongInt = SomeOtherUnit.specialize TTest<LongInt>;

While this is not backwards compatible this situation should arise seldomly enough and the benefits especially in context with generic functions/procedures/methods outway the drawbacks.

pbase.pas:
  * try_consume_unitsym: add a allow_specialize parameter that allows to parse "specialize" in front of a non-unit symbol; whether it was a specialization or not is reported using a new is_specialize parameter
  + add a new overload try_consume_unitsym_no_specialize that calls try_consume_unit sym with allow_specialize=false and a dummy is_specialize parameter
  * switch calls to try_consume_unitsym to try_consume_unitsym_no_specialize
pstatmnt.pas, try_statement:
  * switch call to try_consume_unitsym to try_consume_unitsym_no_specialize
  * adjust call to parse_nested_types
ptype.pas:
  + extend id_type with the possibility to disallow unit symbols (needed if a specialize was already parsed) and to report whether a specialize was parsed
  + extend parse_nested_types with the possibility to tell it whether specializations are allowed
  * have parse_nested_types specialize generic defs if one is encountered and local type defs are allowed
  * id_type: only allow "unitsym.specialize sym" or "specialize sym", but not "specialize unitsym.sym"
  * single_type: correctly handle specializations with "specialize" keyword
  * read_named_type.expr_type: there is no longer a need to check for "specialize" keyword
pexpr.pas:
  + new function handle_specialize_inline_specialization which tries to specialize a type symbol
  * handle_factor_typenode: handle specializations after a point that follows a record or object (why isn't this part of postfixoperators anyway? O.o)
  * postfixoperators: handle "specialize" after records and objectdefs
  * factor_read_id: handle "specialize" in front of an identifier (and after unit symbols)

+ added tests
* adjusted test webtbs/tw16090.pp

git-svn-id: trunk@29768 -
2015-02-20 16:23:40 +00:00
Tomas Hajny
7049e40668 * character ASCII 127 should not be treated as invalid result of Unicode to ansistring conversion because it is used as replacement character for characters missing in the target codepage by the native OS/2 Unicode support routines
git-svn-id: trunk@29706 -
2015-02-15 14:31:36 +00:00
Tomas Hajny
46bfe5c1dd * set ShortDateFormat explicitly so that StrToDate behaviour can be tested easily regardless of current locale
git-svn-id: trunk@29703 -
2015-02-15 11:28:17 +00:00
Tomas Hajny
41312d44b4 * set DecimalSeparator explicitly so that Format output can be tested easily regardless of current locale
git-svn-id: trunk@29701 -
2015-02-15 11:14:55 +00:00
Tomas Hajny
e1b37dcc46 * the test made compilable also on other platforms than only Unix and Windows
git-svn-id: trunk@29699 -
2015-02-15 01:34:47 +00:00
Tomas Hajny
90aeabb439 * skip this test under OS/2, because it expects that replacement used for characters not supported in the current codepage must match between compile time ('?' used by FPC) and run-time (ASCII 127 used by OS/2 native Unicode routines)
git-svn-id: trunk@29698 -
2015-02-15 01:31:27 +00:00
Tomas Hajny
fbb6776085 * this test results in a SIGSEGV under OS/2, but I consider it a correct behaviour if a nil pointer for passing a nil as a buffer to BlockWrite
git-svn-id: trunk@29697 -
2015-02-15 01:04:32 +00:00
Tomas Hajny
d2ae1f0ab2 * skip emx too
git-svn-id: trunk@29696 -
2015-02-15 01:01:56 +00:00
Tomas Hajny
60c5f29b5b * add path setting for some previously missing platforms (OS/2, MSDOS)
git-svn-id: trunk@29695 -
2015-02-14 20:46:58 +00:00
florian
3ed1a75fcd * write ok on exit for easier testing
git-svn-id: trunk@29693 -
2015-02-14 17:39:32 +00:00
Tomas Hajny
2e2ca8684d * add resolution of DLL name under OS/2
git-svn-id: trunk@29689 -
2015-02-13 22:36:49 +00:00
svenbarth
a7085ea34e Added test for Mantis #25044 which has been fixed in revision 29537.
git-svn-id: trunk@29687 -
2015-02-13 17:02:07 +00:00
svenbarth
04534d5dcf Fix for Mantis #27424.
pgenutil.pas:
  * parse_generic_parameters: a ';' terminates a parameter group, so correctly adjust firstidx in that case

+ added test

git-svn-id: trunk@29685 -
2015-02-13 13:50:47 +00:00
florian
932b68310e * do not warn about internally generated parameters, resolves #25914
git-svn-id: trunk@29636 -
2015-02-06 20:44:24 +00:00
florian
42020c8bb8 * when passing a parameter by var/out, its address leaves the current scope so the compiler has to take care of this
* when getting rid of temps. of inline parameters, take care if somewhere an alias of the variable might exist, resolves #24796 and #26534

git-svn-id: trunk@29616 -
2015-02-03 21:05:39 +00:00
florian
461821d1a5 * read array initializations in generic subroutines without fixed limits, resolves #25602
git-svn-id: trunk@29598 -
2015-02-01 17:09:00 +00:00
svenbarth
ba75fd62f0 Fix for Mantis #27348. Applied patch by Do-wan Kim plus comments for the reason.
symdef.pas:
  * tprocdef.defaultmangledname: add some kind of differentiator to the result def, so that x(integer;integer) and x(integer):integer generate different mangled names
  * make_mangledname: also use the returndef instead of a potentially uninitialized variable like was done for tprocdef.defaultmangledname and also add a prefix (so that the two are compatible)

+ added test

git-svn-id: trunk@29579 -
2015-01-30 13:49:25 +00:00
svenbarth
943a094683 Fix for Mantis #27320.
symdef.pas, tprocdef:
  * defaultmangledname: don't use the potentially unassigned hp, but use - as intended - returndef if it is set (analog to the non-CRC part)

+ added test

git-svn-id: trunk@29537 -
2015-01-23 16:47:23 +00:00
sergei
26cd3dc58a * %OS -> %target, the former is invalid and breaks the entire run.
git-svn-id: trunk@29504 -
2015-01-18 16:09:45 +00:00
florian
94a51e26a0 + support of winapi directive
git-svn-id: trunk@29500 -
2015-01-18 10:50:53 +00:00
svenbarth
0d1d3d8e72 Fix for Mantis #25917. With this change the visibility of type parameters is changed from public to strict private as otherwise unexpected (and "unworkaroundable") errors might occur (like the one in the mentioned bug report).
pgenutil.pas:
  * parse_generic_parameters & insert_generic_parameter_types: create the type parameter symbols as strict private instead of public (which is the default visiblity)

* adjusted two tests which relied on this behavior (that's why I fixed the type aliases previously)
+ added test

git-svn-id: trunk@29486 -
2015-01-16 17:02:02 +00:00
svenbarth
5115c3e680 Fix for Mantis #26481. This is a regression.
nutils.pas, handle_staticfield_access:
  * generics don't have staticvarsyms for their static fieldvarsyms so we need to simulate a non-static access to avoid 1) an exception and 2) incorrect errors that instance methods can't be accessed

+ added tests

git-svn-id: trunk@29484 -
2015-01-16 16:05:53 +00:00
svenbarth
5fd47d5e00 Fix for Mantis #26483. This regression was introduced by famous revision 27861 which introduced partial specializations (and thus that specializations can be part of local- and parasymtables as well).
symtable.pas, is_visible_for_object:
  * if the symtable belongs to a specialization we need to ignore any owning local- or parasymtable as well to determine which unit it belongs to

+ added test

git-svn-id: trunk@29482 -
2015-01-16 14:23:49 +00:00
florian
ccb01d6196 * allow subtraction/addition of internally generated nodes, resolves #27256
git-svn-id: trunk@29456 -
2015-01-12 20:56:17 +00:00
pierre
1590ba813d Test skipped for go32v2, because it forbids the testsuite to complete without manually killing the program
git-svn-id: trunk@29454 -
2015-01-12 16:54:39 +00:00
pierre
c19f3d6994 Test fix Revision 29450 fro bug report 27294.
git-svn-id: trunk@29452 -
2015-01-12 15:13:15 +00:00
svenbarth
af43e5e3e9 Fix for Mantis #24872.
psub.pas, tcgprocinfo.parse_body:
  * also check record symtables besides object symtables to determine whether the staticsymtable is accessed from a globally declared generic
  * use a translateable message if the static symtable is accessed if it should not
msg/errore.msg:
  + add new error message for when the static symtable is accessed from a global generic
msgidx.inc & msgtixt.inc:
  * regenerated

+ added test

git-svn-id: trunk@29427 -
2015-01-06 20:46:12 +00:00
Jonas Maebe
bad1b2a1c1 * fix for issue introduced in r28862: the compiler considered also
dynamic arrays and fixed-length static arrays when looking for
    overloads of array constructors, while these are not valid in
    such cases (and it also gave an error afterwards when trying to
    actually use them). This caused a lot of spurious "can't select
    which overloaded routine to call" errors when using many JVM
    routines

git-svn-id: trunk@29393 -
2015-01-04 19:41:21 +00:00
florian
29d4037a9c * make integer division instruction (div/idiv) on x86 dependent on the
resulttype of the div node set by the type checking pass, this is 
  also how the generic code generator handles it, resolves #27173

git-svn-id: trunk@29382 -
2015-01-04 13:08:57 +00:00
Jonas Maebe
476e3fabb7 * fixed big endian bugs in variant dispatching
* fixed size calculation of vardatetime arguments on 32 bit systems with
    variant dispatching

git-svn-id: trunk@29319 -
2014-12-24 14:13:49 +00:00
svenbarth
b38fb606cc Fix for Mantis #27185.
ngenutil.pas:
  * AddToStructInits: also process the class constructors/destructors of nested types

+ added test

git-svn-id: trunk@29308 -
2014-12-21 14:01:32 +00:00
florian
4289dd667d * managed types cause a different warning/hint when they are
used uninitialized, so users can turn off these messages if they want, resolves #24601 and #26403

git-svn-id: trunk@29295 -
2014-12-14 20:48:54 +00:00
florian
c9ba9665dd * set nf_internal for if nodes generated by assert, prevent warning for assert(true); resolves #26467
git-svn-id: trunk@29293 -
2014-12-14 19:41:22 +00:00
florian
f1eb00a450 * do not issue a hint about uninitialized var-parameters, resolves #25916
git-svn-id: trunk@29289 -
2014-12-14 17:54:37 +00:00
florian
bb01872821 + handle -CPPACKENUM and -CPPACKRECORD, resolves #27153
git-svn-id: trunk@29283 -
2014-12-13 21:08:18 +00:00
svenbarth
7b216d7fa6 Fix for Mantis #27120.
pdecobj.pas, parse_object_members:
  * also allow class fields for helper types

+ added tests

git-svn-id: trunk@29270 -
2014-12-12 13:57:43 +00:00
svenbarth
9611c3df52 Fix for Mantis #25606.
pexpr.pas, postfixoperators:
  * try_type_helper: also allow type helpers for block type bt_const

+ added test

git-svn-id: trunk@29176 -
2014-11-28 22:06:10 +00:00
svenbarth
fa1bc0757d Fix for Mantis #26922.
pgenutil.pas, specialization_init:
  * don't push the localsymtable if the unit does not have one available

+ added test (needs manual execution though... :/ )

git-svn-id: trunk@29172 -
2014-11-28 16:35:28 +00:00
florian
854fa1d4b9 * force advanced records into memory when they are used as self, resolves #26075
git-svn-id: trunk@29139 -
2014-11-23 22:05:40 +00:00
florian
9a31cba3d3 * do not blindly insert decimal seperators in StrToFloat, resolves #27029
git-svn-id: trunk@29126 -
2014-11-23 20:18:19 +00:00
pierre
8808308843 Fix bug introduced in commit 29091
git-svn-id: trunk@29117 -
2014-11-23 09:29:11 +00:00
pierre
d98a7d39f5 Add check for absolute word type
git-svn-id: trunk@29091 -
2014-11-19 07:30:26 +00:00
sergei
475a9e1617 * Asm readers: allow using procedure symbols in references, resolves #22376.
* rax86int.pas: reject RIP-relative references to locals/parameters.

git-svn-id: trunk@29087 -
2014-11-17 05:34:55 +00:00
michael
34941fde71 * Test for bug ID #26773
git-svn-id: trunk@28997 -
2014-11-05 22:23:56 +00:00
michael
cbd817b5e8 * Test for bug ID #26773
git-svn-id: trunk@28996 -
2014-11-05 22:21:55 +00:00
michael
3563944752 * Patch to allow changing TVarRec data (bug ID 26773)
git-svn-id: trunk@28995 -
2014-11-05 22:17:54 +00:00
Jonas Maebe
979761493f + test for r28985
git-svn-id: trunk@28987 -
2014-11-04 21:16:57 +00:00
Jonas Maebe
b662d63258 * mark the global variable as "public;" so its assembler symbol is exported
(because @gotpcrel shouldn't be used for non-global/exported symbols on
     some platforms, such as OS X)
   o fixes the test on OS X

git-svn-id: trunk@28986 -
2014-11-04 21:16:29 +00:00
Jonas Maebe
6712954607 * correctly handle X86_64_X87UP_CLASS getting merged with another class and
becoming X86_64_SSE_CLASS/X86_64_INTEGER_CLASS/... This is not defined in
    the ABI because there sizeof(extended)=16 and hence the class of the upper
    eightbyte of the extended value can never be merged with the class of
    another field (except in a union, but then the class of the lower
    eightbyte will also be overwritten).

    Handle it the same as when the lower eightbyte class of an extended in an
    aggregate gets changed into something else: pass everything in memory
    (part of mantis #26993)

git-svn-id: trunk@28984 -
2014-11-04 21:16:24 +00:00
sergei
07ab3fbec4 * Fixed RTTI name mangling for nested types, resolves #26069.
git-svn-id: trunk@28958 -
2014-11-01 14:54:16 +00:00
Jonas Maebe
dc4a2a59f7 * initialise mineq before exiting the parameter checking loop for open array
parameters (bug in r28862, mantis #26976)

git-svn-id: trunk@28954 -
2014-10-31 20:45:54 +00:00
Jonas Maebe
d117402673 + test for mantis #21449, already fixed in the mean time
git-svn-id: trunk@28863 -
2014-10-17 16:32:12 +00:00
Jonas Maebe
f1c45eeae3 * support passing [nil] to an array of class/objcclass/javaclass/intf/...
in {$mode objfpc} (mantis #19452)

git-svn-id: trunk@28862 -
2014-10-17 16:10:55 +00:00
Jonas Maebe
1334fe10c1 + test for mantis #19622, fixed by sergei in r28266
git-svn-id: trunk@28861 -
2014-10-17 15:28:25 +00:00
Jonas Maebe
b0639405ac * compare the actual target nodes when checking whether the result of an
inline function is getting assigned to one of its parameters, so that
    typecasts etc. are dealt with correctly (mantis #26536)

git-svn-id: trunk@28834 -
2014-10-16 17:49:02 +00:00
Jonas Maebe
5b39b20a3d * fixed duplicate field names in variant record parts
git-svn-id: trunk@28822 -
2014-10-15 10:08:43 +00:00
Jonas Maebe
5c8ae259c4 * handle GOT-relative loads in the assembler reader as reads of
sizeof(pint) bytes (mantis 23109)

git-svn-id: trunk@28789 -
2014-10-08 18:38:06 +00:00
sergei
de42f2f2f7 * Fixed handling of sign in constant expressions in Intel x86 assembler reader. Mantis #26668.
git-svn-id: trunk@28731 -
2014-10-03 15:51:38 +00:00
marcus
8c2a1ed026 Amiga: sockets, fcl-net, fcl-web included.
git-svn-id: trunk@28709 -
2014-09-22 18:12:43 +00:00
svenbarth
16774350d7 Fix for Mantis #26749 .
pgenutil.pas, generate_specialization:
  * first check whether we can reuse the current specialization or another specialization and only /then/ retrieve the symtable to specialize to

+ added test

git-svn-id: trunk@28705 -
2014-09-21 19:15:37 +00:00
svenbarth
684c8842e7 Fix for Mantis #26599.
pgenutils.pas, check_generic_constraints:
  * correctly handle forward defs if the constraint is either a single IInterface/IUnknown or a TObject/class

+ added tests

git-svn-id: trunk@28601 -
2014-09-05 14:42:22 +00:00
svenbarth
244ac12794 Fix for Mantis #26615.
htypechk.pas, tcallcandidates:
  * collect_overloads_in_struct: we need to check the deftyp of the extended def for record- or objectdef, not the deftyp of the helper which will always be objectdef anyway.

+ added test

git-svn-id: trunk@28572 -
2014-09-01 07:18:02 +00:00
Jonas Maebe
88d969f3bd * ensure that sysutils.expandfilename() returns its result in
DefaultRTLFileSystemCodePage instead of in DefaultFileSystemCodePage
    (mantis #26627)

git-svn-id: trunk@28570 -
2014-08-31 21:27:57 +00:00
florian
d407d8ec7e * thumb has no mla instruction support
git-svn-id: trunk@28543 -
2014-08-30 20:42:40 +00:00
sergei
a61321b4bd * m68k "rts" instruction has code $4e75 ($4e74 is "rtd" which is wrong here)
git-svn-id: trunk@28254 -
2014-07-24 12:03:34 +00:00
sergei
4e9500fee8 * Extended the test for m68k.
git-svn-id: trunk@28253 -
2014-07-23 19:34:15 +00:00
svenbarth
856ae9d3cf Fix for Mantis #26482.
pgenutil.pas, generate_specialization:
  * also search for the generic type in general if it was previously found in a record/class as there might be a non-generic type (or one with a different number of parameters) defined elsewhere

+ added test

git-svn-id: trunk@28244 -
2014-07-20 15:47:18 +00:00