Commit Graph

6305 Commits

Author SHA1 Message Date
nickysn
1709fa61a4 + extended test tasm17.pp with 'dw offset @jumptarget', 'dd @jumptarget' and
'dd offset @jumptarget'

git-svn-id: trunk@38166 -
2018-02-08 16:13:27 +00:00
nickysn
dd04114af9 + extended test tasm17.pp with 'DW @jumptarget'
git-svn-id: trunk@38165 -
2018-02-08 15:46:53 +00:00
nickysn
d65fb1907a + extended test tasm17.pp with 'DW/DD const+offset x'; unfortunately, TP7 also
supports 'DW/DD offset const+x', which we don't and I don't know whether we
  should

git-svn-id: trunk@38164 -
2018-02-08 15:41:03 +00:00
nickysn
b2d71f6f66 * fix test tasm17.pp for the i8086 huge memory model
git-svn-id: trunk@38156 -
2018-02-07 16:35:24 +00:00
nickysn
0c1062bb45 + extended test tasm17 with 'DW/DD xx+constant' and 'DW/DD OFFSET xx+constant'
git-svn-id: trunk@38155 -
2018-02-07 16:33:03 +00:00
nickysn
70cbb8c326 + added test for 'DW/DD OFFSET xx' on i8086
git-svn-id: trunk@38154 -
2018-02-07 16:20:22 +00:00
nickysn
d86e5d006c + added test for seg(x) and ofs(x) initialized typed constants in TP mode as well
+ added directive for using the FPC compiler mode in test tsegofs1.pp

git-svn-id: trunk@38135 -
2018-02-06 13:27:36 +00:00
florian
a29f968b3b * patch by Christo Crause: generate parameter location information in att assembler mode, resolves #32915
* forbid that parameters are subscribed in assembler, if they are references and take more than one register
+ test

git-svn-id: trunk@38125 -
2018-02-05 22:11:00 +00:00
svenbarth
640480272f * adjust TThread.Synchronize so that it also works correctly if the passed in thread instance is not the instance of the current thread
+ added test

git-svn-id: trunk@38124 -
2018-02-05 21:50:00 +00:00
nickysn
f351b6acc9 + added an i8086 test for typed constants, initialized with ofs(x) or seg(x)
git-svn-id: trunk@38122 -
2018-02-05 16:24:35 +00:00
nickysn
50acde9e36 + also add 'rep; db $66; movsw' to the tasm16.pp test
git-svn-id: trunk@38098 -
2018-02-01 20:00:43 +00:00
nickysn
1f0e311fdd + allow segment override prefixes to be used as a standalone opcode in the intel
syntax inline assembler; this is TP7 compatible and allows compiling ugly
  code, such as 'seges; db $67,$66; lodsw'

git-svn-id: trunk@38096 -
2018-02-01 17:31:59 +00:00
florian
6b5a514148 * based on a patch by Christo Crause: in finalizeavrcode, ignore assembler breq statements taking an absolute value, resolves #32109
git-svn-id: trunk@38089 -
2018-01-31 18:38:33 +00:00
florian
0662b611ca * patch by Christo Crause: prevent that the compiler converts breq into jmp in inline assembler blocks, resolves #32949
git-svn-id: trunk@38088 -
2018-01-31 18:34:42 +00:00
florian
10516f21f8 * patch by Christo Crause to resolve #33098: AVR - LDS assembler instruction with absolute address gives compiler error
git-svn-id: trunk@38082 -
2018-01-30 20:22:42 +00:00
florian
796eb542be * LDD/STD need always an offset, resolves #33086
git-svn-id: trunk@38072 -
2018-01-28 21:06:13 +00:00
florian
92e616e30c * error happens only with optimization
git-svn-id: trunk@38071 -
2018-01-28 14:41:57 +00:00
florian
10ea652493 * fix for #32576
+ test case

git-svn-id: trunk@38069 -
2018-01-28 13:26:49 +00:00
florian
f61b074912 * (re)store alignment when doing a $push/$pop
git-svn-id: trunk@38020 -
2018-01-22 21:06:07 +00:00
svenbarth
22932493b9 * if the debug info of a parent def is considered as queued then ensure that it is indeed queued (if it should already be in the list then the duplicate entry would have the state written if it's checked and thus ignored)
+ added test

git-svn-id: trunk@37969 -
2018-01-14 16:46:10 +00:00
michael
f6a08a2c74 * Patch from Ondrej Pokorny to allow correct nodefault/stored for strings
git-svn-id: trunk@37954 -
2018-01-13 10:22:16 +00:00
florian
4a98fcb9d3 * patch by J. Gareth Moreton: reorganises the produced machine code for large unsigned divisions, resolves #32984
git-svn-id: trunk@37950 -
2018-01-12 22:03:52 +00:00
florian
52aa40c3b0 * remove explicit cast to int64 to avoid an internalerror 200706094, resolves #33004
git-svn-id: trunk@37946 -
2018-01-11 21:02:39 +00:00
florian
11a3d8762a * patch by J. Gareth Moreton:
- Moved the part that emits the CMOV command outside of the if-else block, because it's the same in both branches and was just duplicated code.
  - Moved a comment about powers of 2 to be right before the correct if-else block.
  - Added a couple of comments to explain what the algorithm is doing to obtain the remainder.
  - Added missing "writeln('ok');" (since 'tmoddiv3.pp' has it) and program header to 'tmoddiv4.pp'.
  - Changed program name from "testfile2" to "tmoddiv3" in 'tmoddiv3.pp'.

git-svn-id: trunk@37939 -
2018-01-09 20:04:49 +00:00
Jonas Maebe
5f7d3e16f5 * increase comment nesting level when "(*" is followed by another '*'
(mantis #32019)

git-svn-id: trunk@37935 -
2018-01-07 21:05:50 +00:00
Jonas Maebe
a2217cedd5 * evaluate the lower and upper bounds of for-loops in ISO mode using the
ISO-defined range type, instead of using the type of the iteration
    variable (mantis #24318)

git-svn-id: trunk@37934 -
2018-01-07 18:51:53 +00:00
Jonas Maebe
0f0bdabb89 * if an absolute typeconversion changes the size, make the source not
regable. Normally this is done when the absolute typeconversion node
    gets created, but the size can sometimes still change afterwards (e.g.
    when removing superfluous 64 bit type conversions) (mantis #32160)

git-svn-id: trunk@37930 -
2018-01-07 15:37:23 +00:00
Jonas Maebe
53bef8d202 * fixed calculation of high parameter for arrays with non-integer bounds
(mantis #32645)

git-svn-id: trunk@37928 -
2018-01-07 13:01:14 +00:00
Jonas Maebe
ae087b92d7 * when creating a unique type alias for an object, class or interface,
create a child object/class/interface instead of a copy of the original.
    This fixes override/inheritance checks, and is also Delphi-compatible

git-svn-id: trunk@37927 -
2018-01-07 12:25:16 +00:00
Jonas Maebe
2919d97f91 * support asssigning @class.classmethod to a procvar of object in FPC modes
(mantis #14103)

git-svn-id: trunk@37925 -
2018-01-06 17:47:44 +00:00
florian
81b2cf5d65 * slightly modified patch by J. Gareth Moreton: Optimization for 'mod' on i386/x86-64, resolves #32945
git-svn-id: trunk@37922 -
2018-01-06 14:58:28 +00:00
Jonas Maebe
1934285c20 * don't convert "int64(sint32) * cardinal_const" into a 32x32->64
multiplication (mantis #32046)

git-svn-id: trunk@37921 -
2018-01-06 13:44:03 +00:00
florian
273045c295 * use the first element of the filrec._private array to track eof for typed files in iso mode (this will not hurt as iso mode does not specify the _private field), resolves #32938
git-svn-id: trunk@37915 -
2018-01-05 22:10:39 +00:00
Jonas Maebe
320a699967 * fixed storing the symbols of the global macro symbol table in the ppu in
macpas mode after r32153
   o adjusted test so it checks this

git-svn-id: trunk@37912 -
2018-01-04 20:51:39 +00:00
Jonas Maebe
8cfe7e0a0c * when creating a realconstn, cast the value to the specified type
(mantis #25121)
   o note that this means that single_const1/single_const2 will now be rounded
     to single, instead of staying the at maximum precision
   o fixed FahrenheitToCelcius() to handle this change correctly

git-svn-id: trunk@37911 -
2018-01-04 20:51:36 +00:00
Jonas Maebe
118398a543 * test for mantis #32906 (already fixed in revision 37886)
git-svn-id: trunk@37892 -
2018-01-02 18:15:30 +00:00
Jonas Maebe
c0b0fa9c0b * change the type of the -gt uninitialised result of ansistring functions to
rawbytestring so the compiler does not try to convert it to the declared
    string type of the function result, as this may not be available
    (mantis #32510)

git-svn-id: trunk@37889 -
2018-01-01 18:04:13 +00:00
Jonas Maebe
672afcdca2 * check for conflicts between procedure directives specified in the
implementation and "virtual" (if it's a virtual method), as "virtual"
    does not get repeated in the implementation and hence no conflicts get
    checked by default (mantis #32605)

git-svn-id: trunk@37887 -
2018-01-01 16:54:04 +00:00
Jonas Maebe
1b66995754 * factored out check to determine whether a variable can be subscripted in
inline assembly, and fixed check after r35959 (mantis #32318)
   o can also subscript parameters passed by value on the stack
   o can also subscript local variables, the parameters passed by reference
     that are subsequently copied into a local

git-svn-id: trunk@37886 -
2018-01-01 14:29:21 +00:00
Jonas Maebe
dcac6b9c6f * disallow passing a dynarray(niln/pointerconstn) as an open array
(mantis #31273)

git-svn-id: trunk@37885 -
2017-12-31 15:18:40 +00:00
florian
0f51cf8546 * avr: correctly write references to nil, resolves #32821
git-svn-id: trunk@37838 -
2017-12-28 10:32:16 +00:00
florian
5e26142e54 * selected features are now stored in the system unit
git-svn-id: trunk@37772 -
2017-12-20 21:29:10 +00:00
svenbarth
afa6d1bdb0 * extend test a little bit to ensure that nested Concat() calls for strings work correctly
git-svn-id: trunk@37724 -
2017-12-12 19:54:38 +00:00
svenbarth
916ff0b92c + extend Concat() with support for dynamic arrays
+ added test

git-svn-id: trunk@37723 -
2017-12-12 19:54:08 +00:00
nickysn
b571f48735 * fixed the return type of FarAddr(), so that it is assignment compatible to
typed far pointers as well

git-svn-id: trunk@37629 -
2017-11-27 19:42:36 +00:00
nickysn
78e0f6c68b + added an i8086-specific FarAddr() function, similar to Addr(), but always
returns a far pointer, regardless of the current memory model

git-svn-id: trunk@37628 -
2017-11-27 16:41:48 +00:00
nickysn
51489f9186 + added test for the StrUpper() and StrLower() functions in the strings unit
git-svn-id: trunk@37617 -
2017-11-24 15:59:20 +00:00
nickysn
c464f7fa56 * fixed the SEG inline asm directive when used with 32-bit registers on the i8086 target
git-svn-id: trunk@37613 -
2017-11-22 15:04:30 +00:00
florian
0f637434a3 * disable test on avr
git-svn-id: trunk@37609 -
2017-11-19 18:05:22 +00:00
florian
3352311124 * disable test on avr as it works only with table driven init/final code
git-svn-id: trunk@37605 -
2017-11-19 18:05:16 +00:00
nickysn
ae92973196 + added support for the retw, retnw, retfw, retd, retnd, retfd, retq, retnq and
retfq x86 instructions. These are variants of the ret instruction with the
  return offset size set explicitly, e.g. retfw is a 16-bit far ret (i.e. pops
  a 16-bit offset and a 16-bit segment), retfd is a 32-bit far ret (pops a
  32-bit offset, followed by a 16-bit segment), etc.

git-svn-id: trunk@37571 -
2017-11-10 16:53:29 +00:00
nickysn
3cbe377f40 + added 2 tests for absolute var access to a 2-dimensional array from within inline asm
git-svn-id: trunk@37562 -
2017-11-06 16:47:07 +00:00
nickysn
20f905db6c + added i8086-only tag to test tasmabs3.pp
git-svn-id: trunk@37561 -
2017-11-06 16:43:13 +00:00
nickysn
24d447716e * fixed support for access from inline asm to absolute vars, pointing to an
array element (previously, it would always point to the start of the array)

git-svn-id: trunk@37558 -
2017-11-06 16:06:34 +00:00
nickysn
d570c09b9d + added test, which tests public labels as well as 'external far' variables on i8086
git-svn-id: trunk@37533 -
2017-10-30 18:08:39 +00:00
nickysn
be3ff9128a + added an i8086 test for the public directive
git-svn-id: trunk@37531 -
2017-10-30 17:02:48 +00:00
nickysn
29558a74cd + support exporting labels from asm blocks in intel syntax asm blocks via the
'public' directive

git-svn-id: trunk@37530 -
2017-10-30 16:44:13 +00:00
nickysn
d318ab086a * when handling absolute vars from within intel inline assembly, take the
absolute var size into account (not the type of the var it points to or no
  size at all, if it points to a fixed address)

git-svn-id: trunk@37525 -
2017-10-26 15:58:48 +00:00
nickysn
8a0d8f025b * fixed another i8086 inline asm 32-bit constant bug (e.g. in 'or eax, 80000001h')
git-svn-id: trunk@37521 -
2017-10-25 19:38:37 +00:00
nickysn
07eab50afe + added a test for 32-bit inline asm const operand on i8086, using at&t syntax as well
git-svn-id: trunk@37520 -
2017-10-25 18:09:11 +00:00
nickysn
325e66287c * fix for inline asm of instructions with 32-bit constant operands on i8086
git-svn-id: trunk@37519 -
2017-10-25 18:03:22 +00:00
nickysn
e58bad8eef + check for the 'pop cs' instruction in the x86 inline assembler and print a
warning (on the i8086 target) or an error (on i386 and x86_64) when this
  instruction is used (because it only works on 8086 and 8088 CPUs)

git-svn-id: trunk@37514 -
2017-10-24 15:07:20 +00:00
nickysn
e8bbc4eef9 + support the xlat x86 instruction syntax with a memory operand. This allows
specifying the address size (e.g. xlat byte ptr [bx] or xlat byte ptr [ebx])

git-svn-id: trunk@37478 -
2017-10-17 16:40:06 +00:00
pierre
d18627f0af * Update all fpcsrc Makefile's using latest fpcmake version 2017-09-21 rev 37286
git-svn-id: trunk@37462 -
2017-10-16 00:27:27 +00:00
nickysn
4a8aec26bf * fixed test tasm12c.pp (uses asmmode intel, not att)
git-svn-id: trunk@37457 -
2017-10-14 11:32:54 +00:00
nickysn
dd9b5eb2aa + added the 'Cannot override ES' message in the at&t assembler reader as well
git-svn-id: trunk@37456 -
2017-10-14 00:48:46 +00:00
nickysn
27978de111 + extended tests with segment overrides in at&t asm mode
git-svn-id: trunk@37455 -
2017-10-13 15:43:47 +00:00
nickysn
1ee36b5b9b + added error message in the intel assembler reader, when an attempt is made to
override the ES segment in an x86 string instruction (because it cannot be
  overriden)

git-svn-id: trunk@37454 -
2017-10-13 14:56:38 +00:00
nickysn
0fb79946a5 + added support for the parameterized versions of the x86 string instructions
(movs, cmps, scas, lods, stos, ins, outs) in the inline asm of the i8086, i386
  and x86_64 targets. Both intel and at&t syntax is supported.
* NEC V20/V30 instruction 'ins' (available only on the i8086 target, because it
  is incompatible with 386+ instructions) renamed 'nec_ins', to avoid conflict
  with the 186+ 'ins' instruction.

git-svn-id: trunk@37446 -
2017-10-12 00:07:02 +00:00
pierre
c8722d4237 Fix tw32115 test for msdos target by using longint type explicitly for CalcSmth function parameter
git-svn-id: trunk@37445 -
2017-10-11 06:25:31 +00:00
svenbarth
fcc1ce7a08 * fix for Mantis #30344: applied patch by Mario Ray Mahardhika to add new command line option -Sj[-|+] to control writeable typed constants (with a small adjustment to the help text)
+ added test

git-svn-id: trunk@37437 -
2017-10-09 19:19:23 +00:00
svenbarth
f6a867ef04 * move handling of Concat to tinlinenode so that it can be easily extended for dynamic arrays
+ added test

git-svn-id: trunk@37429 -
2017-10-08 10:39:34 +00:00
florian
3d3298f64d * write absolute references correctly on avr, resolves #32040
git-svn-id: trunk@37419 -
2017-10-07 21:09:20 +00:00
florian
4cf2a2672a changes to fix #32043
* changed most of the variables in the assembler readers used to store constants from aint to tcgint 
  as aint has only the size of the accumular while some CPUs (AVR) allow larger constants in instructions
+ allow access to absolute symbols with address type in inline assembler
* allow absolute addresses in avr inline assembler
+ tests

git-svn-id: trunk@37411 -
2017-10-06 21:07:19 +00:00
nickysn
8ba4de3885 + test lea with non-native address sizes (16-bit on i386, 32-bit on x86_64)
git-svn-id: trunk@37410 -
2017-10-06 15:46:03 +00:00
florian
cc44328109 * correctly calc case label distance after r36362, resolves #32115 and #32311
git-svn-id: trunk@37390 -
2017-10-03 20:36:09 +00:00
florian
c0feaf1f1e + allow absolute to absolute symbols, resolves issue #32474
git-svn-id: trunk@37379 -
2017-10-01 19:54:44 +00:00
svenbarth
9619576515 + add support for $SetPE{OS,SubSys,User}Version directives; Delphi compatible; Note: $SetPEUserVersion takes precedence to $Version
+ added test

git-svn-id: trunk@37364 -
2017-09-30 13:55:29 +00:00
svenbarth
81a0f88d8c + add Delphi compatible TThread.ForceQueue() which enqueues the method also for the main thread (at least if the RTL is in multi threading mode, otherwise it's still executed right away - whether this is Delphi compatible needs to be tested as I only have a 10.1 currently which does not yet support TThread.ForceQueue())
+ added test

git-svn-id: trunk@37359 -
2017-09-29 21:19:45 +00:00
svenbarth
c5b33f51f9 * fix for Mantis #32412: correctly handle an incorrect parameter count for Delete() and Insert() intrinsics
+ added tests

git-svn-id: trunk@37342 -
2017-09-27 21:15:00 +00:00
svenbarth
a1c910d892 * fix for Mantis #32108: ensure that types are registered once there is no more specialization is going on
git-svn-id: trunk@37341 -
2017-09-27 20:47:16 +00:00
florian
1c69ae6a15 handle correctly "reg+const" operands in avr assembler, fixes issue #32016
git-svn-id: trunk@37328 -
2017-09-26 20:14:41 +00:00
svenbarth
90bd408de4 * fix for Mantis #32355: adjust the meaning of the typehelpers modeswitch for Delphi modes in that it enables the "type helper" syntax as it is in the non-Delphi modes; extending primitive types with record helpers is now always enabled in Delphi modes
+ added test

git-svn-id: trunk@37225 -
2017-09-15 21:09:21 +00:00
pierre
311a6f7844 Unsert BUILDFULLNATIVE if CROSSCOMPILED is set
git-svn-id: trunk@37218 -
2017-09-15 20:22:56 +00:00
florian
01b950f39b + new test
git-svn-id: trunk@37170 -
2017-09-10 18:07:15 +00:00
maciej-izak
8b5524ac3a * ignore is_publishable for properties in interfaces (related to $M+ directive). $M has effect on visibility of default section for classes. Interface has always only public section (fix for problem in tb0631.pp)
git-svn-id: trunk@37136 -
2017-09-03 19:05:21 +00:00
svenbarth
5c97248f85 + also write the set's size to the RTTI as that simplifies handling in Invoke()
git-svn-id: trunk@37090 -
2017-08-31 19:23:12 +00:00
svenbarth
7b675b6769 * correctly write the type of open array parameters as the element def and not the array def
+ added test that shows the linking error if not done so (otherwise that should already be covered by trtti15.pp)

git-svn-id: trunk@37083 -
2017-08-29 20:17:24 +00:00
svenbarth
83e4585b0f * correctly handle unit identifiers inside specializations of generic routines
git-svn-id: trunk@37080 -
2017-08-29 18:29:10 +00:00
svenbarth
ec7a17d1e3 * extend test for interface helper by tests for "inherited"
git-svn-id: trunk@37061 -
2017-08-25 19:37:44 +00:00
svenbarth
6acba684d4 * class helpers: fix calling virtual methods of the extended type using inherited
git-svn-id: trunk@37060 -
2017-08-25 19:36:56 +00:00
svenbarth
239d0704ca + add support for type helpers to also extend interface types
git-svn-id: trunk@37023 -
2017-08-21 20:49:20 +00:00
svenbarth
7d47c24be2 * fix unit name
git-svn-id: trunk@37021 -
2017-08-21 20:45:46 +00:00
svenbarth
eed63eed5c * document %CONFIGFILE option in ReadMe
git-svn-id: trunk@36995 -
2017-08-20 20:26:38 +00:00
svenbarth
bd6b4b97a7 + add default config file for FPCUnit ConsoleTestRunner
git-svn-id: trunk@36993 -
2017-08-20 20:24:21 +00:00
svenbarth
c7df4d3d2f * implement support for copying a central, pre-created configuration file for a test
git-svn-id: trunk@36992 -
2017-08-20 20:23:50 +00:00
svenbarth
50f3479f64 + add test for the DynArray* functions (currently only DynArraySize() and DynArrayIndex() are tested)
git-svn-id: trunk@36943 -
2017-08-20 15:16:16 +00:00
svenbarth
b478ae031a - remove %NORUN flag (remnant of copy pasting the test)
git-svn-id: trunk@36940 -
2017-08-18 15:32:28 +00:00
svenbarth
324e63b5d3 * a bit of language consolidation: "type helper" can now be used for records and classes as well
git-svn-id: trunk@36938 -
2017-08-18 15:29:19 +00:00
svenbarth
d8ce141e2c * fix program name
git-svn-id: trunk@36935 -
2017-08-18 14:13:59 +00:00
svenbarth
677c35c083 * better fix for detecting Comp's type
git-svn-id: trunk@36879 -
2017-08-12 09:00:06 +00:00
svenbarth
ff927eb11a * fix test due to WideString = UnicodeString and Comp = Extended on some platforms
git-svn-id: trunk@36878 -
2017-08-12 08:56:10 +00:00
svenbarth
0b02dab684 + new Delphi-compatible intrinsic GetTypeKind() which returns the TTypeKind of a type as a constant value (and thus can be optimized away in If- and Case-statements)
+ added test

git-svn-id: trunk@36875 -
2017-08-11 22:12:53 +00:00
svenbarth
c9be061921 * put test files that are outside of the tests directory into a "root" subdirectory of tests
git-svn-id: trunk@36837 -
2017-08-04 13:49:02 +00:00
florian
a2e442e111 * keep the names of X, Y and Z in assembler files, fixes issue #32150
git-svn-id: trunk@36776 -
2017-07-23 19:24:45 +00:00
florian
4ce6575096 * rebuilt Makefile
git-svn-id: trunk@36738 -
2017-07-16 09:24:22 +00:00
pierre
1c4d1d2327 Search for cwsdpmi DOS exeutable in PATH if DOSBOX_NEEDS_CWSDPMI is set or TEST_OS_TARGET is go32v2 to allow testing go32v2 programs using DOSBOX
git-svn-id: trunk@36726 -
2017-07-11 18:07:43 +00:00
svenbarth
0c42b6f44a * fix for Mantis #32118: also provide a range for undefined defs
+ added test

git-svn-id: trunk@36723 -
2017-07-10 19:47:21 +00:00
svenbarth
ca78bfffae * fix for Mantis #32111: allow undefined defs as a for loop's counter; the specialization will decide whether it will compile or not
+ added test

git-svn-id: trunk@36722 -
2017-07-10 19:45:15 +00:00
svenbarth
208800ba2a * regenerate Makefile after r36692
git-svn-id: trunk@36693 -
2017-07-08 20:47:17 +00:00
svenbarth
ba40d4e0f3 * gparmake and createlst are (usually) compiled using the installed host compiler, so don't pass FPCOPT which is geared towards the target compiler instead and thus passes the unit directory of the that compiler's RTL which leads to the compiler picking up the wrong startup object files
git-svn-id: trunk@36692 -
2017-07-08 20:46:51 +00:00
florian
567dfef9a7 + object files for sparc64-linux to test linking with gcc
git-svn-id: trunk@36655 -
2017-07-06 18:02:20 +00:00
pierre
e2beff754f Update 'lonely' (i.e. not regenerated by a fpcmake -r -Tall at fpcsrc level) Makefiles for sparc64-linux target
git-svn-id: trunk@36646 -
2017-07-05 12:17:54 +00:00
Károly Balogh
13d2ae8166 m68k: disabled obsolete test which tested between FPU_NONE and FPU_SOFT defaults...
git-svn-id: trunk@36626 -
2017-07-01 21:29:00 +00:00
Károly Balogh
4001435454 fixed typo in previous commit
git-svn-id: trunk@36614 -
2017-06-29 01:21:35 +00:00
Károly Balogh
a12111e1bd m68k: define safecall_is_cdecl on m68k too in tcalvar6 and tcalst6
git-svn-id: trunk@36613 -
2017-06-29 00:33:55 +00:00
Károly Balogh
50332a97bc textthr test to be more verbose on error conditions
git-svn-id: trunk@36584 -
2017-06-23 06:03:26 +00:00
Károly Balogh
8a6c995b75 troundm: fixed 32bit rmNearest tests and wrong result values
git-svn-id: trunk@36522 -
2017-06-18 18:49:32 +00:00
marcus
d4d7778e86 + Linux/m68k test object files
git-svn-id: trunk@36502 -
2017-06-14 20:33:26 +00:00
florian
f25c9c0956 * hopefully proper fix for 8 and 16 bit CPUs
git-svn-id: trunk@36473 -
2017-06-09 21:05:52 +00:00
florian
0fe5541459 --- Reverse-merging r36464 through r36463 into 'trnd1.pp':
U    trnd1.pp
--- Recording mergeinfo for reverse merge of r36464 through r36463 into 'trnd1.pp':
 G   trnd1.pp
--- Eliding mergeinfo from 'trnd1.pp':
 U   trnd1.pp

git-svn-id: trunk@36472 -
2017-06-09 20:59:46 +00:00
svenbarth
dffe423b10 * fix for Mantis #31945: two fixes for nested routines inside generic methods
a) correctly determine whether token recording is required or not (nested routines of generic routines don't need it)
  b) correctly determine whether the trailing ";" needs to be parsed (nested routines of generic routines need to)

git-svn-id: trunk@36469 -
2017-06-09 15:46:10 +00:00
svenbarth
eb9b4fb71f * fix for Mantis #31973: resolve dummy symbols earlier and print a nice error message if a generic dummy could not be resolved to an ordinary symbol
+ added test
* adjusted test tw9673 which should have never worked as is (what if TList would have been "of T" instead of "of byte"?)

git-svn-id: trunk@36468 -
2017-06-09 14:41:26 +00:00
pierre
abd765da40 Explicitly disable range and overflow checking for this test
git-svn-id: trunk@36465 -
2017-06-09 12:22:47 +00:00
pierre
605e6defc7 Fix compilation due to syntax error in previous commit
git-svn-id: trunk@36464 -
2017-06-09 12:17:04 +00:00
pierre
8c370a4e6f Avoid Data element too large error for I8086 CPU
git-svn-id: trunk@36463 -
2017-06-09 06:11:54 +00:00
maciej-izak
751bde9792 Revert revision 36436 from trunk. Final fix for issue #31675.
git-svn-id: trunk@36446 -
2017-06-07 21:06:54 +00:00
maciej-izak
d3d29fa84c Revert revisions 36133, 36128 from trunk.
git-svn-id: trunk@36436 -
2017-06-06 07:12:26 +00:00
michael
f406d7cbef * Fix bug #31947: upgrade natve unicode implementation to version 9 and CLDR 30 (Patch from Inoussa)
git-svn-id: trunk@36407 -
2017-06-03 16:10:39 +00:00
marcus
ee5096c2ec fpts2junit: fix compilation, remove non printable chars from xml text, cut big error texts to last 1000 chars
git-svn-id: trunk@36372 -
2017-05-30 20:36:16 +00:00
pierre
eec40b3ed0 Fix test for go32v2, by adding explicit loading of cpall unit
git-svn-id: trunk@36353 -
2017-05-28 05:28:20 +00:00
pierre
3a9ed7db72 Limit log size to 50000, and add all testrun information at start
git-svn-id: trunk@36317 -
2017-05-24 21:53:01 +00:00
pierre
53972e6df0 Remove BASEFPCDIR, use FPCDIR instead
git-svn-id: trunk@36314 -
2017-05-24 11:07:45 +00:00
pierre
87bb473780 Fix ExitCode readout if temp directory is used by postponing temp directory cleanup
git-svn-id: trunk@36313 -
2017-05-24 07:41:25 +00:00
svenbarth
72c595eefe + implement support for Insert() for dynamic arrays; the parameter that is inserted can be a dynamic or static array of the same type, an array constructor or a single element of the arrays type; all that is determined based on the second type
+ added test

git-svn-id: trunk@36307 -
2017-05-23 19:11:49 +00:00
Jonas Maebe
744facb7fc * properly support accepting register parameters of assembler routines in
the intel assembler reader: no longer parse them as register tokens,
    but as local operands that are later converted into registers. This
    ensures in particular that the type of the operand is set, which is
    necessary in case this operand later subscripted (as in tasm10a)

git-svn-id: trunk@36288 -
2017-05-21 20:17:15 +00:00
svenbarth
d073e07244 + add a test to ensure that array constructors correctly handle managed types (though there might be a temp floating around for longer than one might expect)
git-svn-id: trunk@36243 -
2017-05-18 20:04:29 +00:00
pierre
c0fd038eaa Start getmem calls with smaller memory chuncks for CPU16 like i8086
git-svn-id: trunk@36240 -
2017-05-18 08:47:03 +00:00
pierre
eea65cd31f + Add UseSignals macro, which conditionally adds
code using signals unit to try to interrupt runaway executables
  + Global DosBoxProcess TProcess class variable.
  + Display modified lines  inside dosbox.conf if verbose
  * Try to use Terminate when program exceeds dosbox_timeout (in seconds)
  * Handle signals if UseSignals macro is set.

git-svn-id: trunk@36231 -
2017-05-16 20:56:29 +00:00
pierre
02eafd63c4 Add disablesplash=true
git-svn-id: trunk@36230 -
2017-05-16 20:51:36 +00:00
pierre
78361f5900 Fix test for msdos targets
git-svn-id: trunk@36229 -
2017-05-16 20:36:49 +00:00
svenbarth
c90fbe1bf0 * fix for Mantis #31795: append a $ to internal functions init, finalize, init_implicit and finalize_implicit as their section names otherwise look the same as those of user declared functions with the same name
+ added test

git-svn-id: trunk@36194 -
2017-05-12 13:32:37 +00:00
svenbarth
23ec3db057 + added test for Mantis #30498 which is working now that array constructors are supported :)
git-svn-id: trunk@36193 -
2017-05-12 12:57:49 +00:00
svenbarth
5971e1327e * fix for Mantis #31756: have array constructors prefer open array parameters instead of dynamic array parameters for backwards compatibility
+ added test

git-svn-id: trunk@36175 -
2017-05-10 21:01:23 +00:00
pierre
6416864997 Revert wrong patch, which lead to an endless loop on linux systems, as directories are modified by each file additions
git-svn-id: trunk@36169 -
2017-05-10 08:43:58 +00:00
pierre
e6aa46f7f9 Add explicit dependency of gparmake and createlst executables to the units/FULL_TARGET subdirectory creation to avoid errors
git-svn-id: trunk@36167 -
2017-05-10 06:29:18 +00:00
nickysn
504662826a * fixed the rtl cpu ifdefs for the rol/ror/sar cpu support check
git-svn-id: trunk@36153 -
2017-05-08 10:16:15 +00:00
nickysn
4a8a7c210a * fixed test on platforms that don't have 8-bit and 16-bit rol/ror
git-svn-id: trunk@36144 -
2017-05-07 13:34:26 +00:00
florian
b3f889e028 * -Ox options are incremental, so disable all optimizations first in case testing is run with -O4
git-svn-id: trunk@36135 -
2017-05-06 18:47:41 +00:00
maciej-izak
6d1ad52dc5 * for symbols used in preprocessor expressions, we don't want to increase references count (for smaller final binaries). Partial fix for problem presented in mantis 31675. Preprocessor functions like declared() in uses section will work only for symbols declared in implicytly included modules (for example like for heaptrc by option -gh, see example/test tw31675.pp)
+ added tests

git-svn-id: trunk@36128 -
2017-05-05 22:27:07 +00:00
nickysn
c28d533bb0 + support the cmpsd sse instruction in the at&t inline assembly reader
git-svn-id: trunk@36124 -
2017-05-05 15:46:47 +00:00
svenbarth
c552b2957a * implement support for 4 Byte UTF-8 codepoints that result in a surrogate pair for UTF-16
git-svn-id: trunk@36116 -
2017-05-05 14:03:57 +00:00
svenbarth
52ddce608f + add test for enumerating a set without ranges
git-svn-id: trunk@36105 -
2017-05-04 22:00:29 +00:00
svenbarth
c349151504 + add test for array constructors
git-svn-id: trunk@36104 -
2017-05-04 21:59:49 +00:00
michael
dff39e9ecb * Fix test case
git-svn-id: trunk@36060 -
2017-05-02 14:03:56 +00:00
nickysn
881cb790a9 + added tests that check side effect removal behaviour for the simplifications
added/changed today

git-svn-id: trunk@36053 -
2017-05-01 21:01:26 +00:00
nickysn
7821d729cd + a very basic test for correctness for the various simplifications, implemented
today. It does not check for side effects and thus it should work at any
  optimization level, regardless of whether each optimization is done or not.

git-svn-id: trunk@36048 -
2017-05-01 20:17:07 +00:00
pierre
c2ec612f1f Makefiel regenerated after commit 35943: Add testppudump rule in tests/tstunits directory
git-svn-id: trunk@35944 -
2017-04-24 21:16:51 +00:00
pierre
ca23830b56 Add testppudump rule in tests/tstunits directory
git-svn-id: trunk@35943 -
2017-04-24 21:16:15 +00:00
nickysn
5393daa994 + added compile time const evaluation for Bsf/Bsr(const) as well
git-svn-id: trunk@35941 -
2017-04-24 20:35:08 +00:00
nickysn
32395bbcbb + added compile time const evaluation optimization for PopCnt(const)
git-svn-id: trunk@35937 -
2017-04-24 16:11:43 +00:00
florian
50dba9ad66 * if both labels of a case label are equal, we still cannot skip the comparison in a jump tree, resolves #31589
git-svn-id: trunk@35880 -
2017-04-21 19:32:27 +00:00
pierre
17b2671213 Regenerate all Makefile's after changes related to FPCDIR checks
git-svn-id: trunk@35833 -
2017-04-18 14:15:47 +00:00
nickysn
256dc546ac + implemented the in_neg_assign_x and in_not_assign_x inline nodes, which will
be used (TBD in a future commit) for optimizing x:=-x and x:=not x on CPUs
  that support performing these operations directly in memory (such as x86)

git-svn-id: trunk@35749 -
2017-04-07 16:02:40 +00:00
maciej-izak
ff28d5c85d * Fix usage of class operators in generics types. If we have generic type declaration/implementation then constraint in comparison to not specialized generic is not "exact" nor "incompatible". Mantis #30534.
git-svn-id: trunk@35740 -
2017-04-05 13:47:21 +00:00
maciej-izak
e4565378db * Allow for "record constraint" in Delphi mode more types like: ordinal, float, classical objects, enumerations (instead of just record). Delphi compatibility. Fix for mantis #24073.
git-svn-id: trunk@35739 -
2017-04-05 13:12:30 +00:00
maciej-izak
8391b73206 * Virtual methods cannot be declared as static (static virtual method has no sense).
+ added tests

git-svn-id: trunk@35724 -
2017-04-03 20:45:52 +00:00
nickysn
f19ebe2acf * fixed compiler internal error in the in_[and/or/xor]_assign_x_y inline nodes
when their second parameter is a large 64-bit unsigned constant

git-svn-id: trunk@35684 -
2017-03-29 14:55:07 +00:00
sergei
8ae0864c9a * x86 Intel asm reader: handle special variables "self" and "result" similar to regular ones in terms of subscripting. This makes fix from r34911 apply to these special variables. Resolves #31542.
git-svn-id: trunk@35669 -
2017-03-27 19:58:55 +00:00
nickysn
fc59649a98 + added inline nodes for handling and/or/xor in place (i.e. x:=x op y, where
op=and/or/xor). They generate more optimal code on certain architectures
  (including x86). The new inline nodes aren't generated by the compiler yet,
  but will be used in the future, at certain optimization levels, whenever the
  pattern x:=x op y is detected by the compiler.

git-svn-id: trunk@35666 -
2017-03-26 23:16:53 +00:00
florian
0897bd154a + align(<int64>,<int64>) and align(<qword>,<qword>), resolves an issue reported on the mailing list with large records
+ tests
* trecordsymtable.insertunionst takes a asizeint parameter
* changed one aint into a asizeint

git-svn-id: trunk@35662 -
2017-03-26 09:35:56 +00:00
svenbarth
34327000d8 + add test for Mantis #31521 which is already fixed, though I don't know which revision did it...
git-svn-id: trunk@35656 -
2017-03-25 13:41:27 +00:00
florian
0cf5ef459d + tcgtypeconvnode.second_class_to_intf supports LOC_CONSTANT as well, resolves #31596
git-svn-id: trunk@35655 -
2017-03-25 10:27:29 +00:00
florian
e8f7c9dfdd + test for large case statements
git-svn-id: trunk@35646 -
2017-03-23 17:57:31 +00:00
sergei
2357ca1fe6 * Fixed size suffix generated for CVTSI2SS, CVTSI2SD, VCVTSI2SS, VCVTSI2SD instructions. Mantis #31550.
* tasm2.pp already detected this bug if run with -al option. Added a copy of tasm2.pp and configured it with -al, so it is run daily on all suitable machines.

git-svn-id: trunk@35626 -
2017-03-19 10:29:28 +00:00
florian
ad557a1da6 * allow call dword ptr eax in delphi, resolves #18225
git-svn-id: trunk@35572 -
2017-03-12 16:37:48 +00:00
florian
bb8b8f2eae * do not set IsMultithread on windows, if no second thread is started, resolves #30535
git-svn-id: trunk@35567 -
2017-03-11 21:35:48 +00:00
yury
4ec547301d * Set both DefaultSystemCodePage in runtime and source file code page to 1252 in order the test perform correctly on all systems.
git-svn-id: trunk@35554 -
2017-03-09 20:37:16 +00:00
florian
5dd6232c0e * fix test for case sensitive file system, resolves #31452
git-svn-id: trunk@35543 -
2017-03-08 20:18:25 +00:00
michael
9787c44c78 * Additional tests from Karl-Michael Schindler
git-svn-id: trunk@35521 -
2017-03-04 17:06:27 +00:00
svenbarth
49e78ac5df * test doesn't need to run
git-svn-id: trunk@35511 -
2017-03-03 21:50:06 +00:00
svenbarth
7dc4f16db3 * fix for Mantis #31431: allow specializations to allow private/protected variables that their generic could have accessed
git-svn-id: trunk@35510 -
2017-03-03 21:45:29 +00:00
svenbarth
ece13bcc5a * fix for Mantis #31465: only consider non-static fields when checking whether a record may be used with Default()
+ added test (Note: the test fails due to missing = operator, but without the fix there was a stack overflow)

git-svn-id: trunk@35508 -
2017-03-03 17:03:46 +00:00
maciej-izak
16a11c8b7a Bug fix for getting pointer to function result (mantis #10933 #19861)
git-svn-id: trunk@35495 -
2017-03-01 13:23:02 +00:00
Jonas Maebe
1adde89621 * copy tcallnode.right after copying the callinitblock, as right can be a
temprefnode referring to a temp from the init block (mantis #31421)

git-svn-id: trunk@35478 -
2017-02-24 19:57:40 +00:00
michael
cc81abdd83 * Patch from Michal Gawrycki to implement streaming interface properties (IComponent) Bug ID
git-svn-id: trunk@35474 -
2017-02-22 21:14:35 +00:00
florian
b9dba41ad0 * intel assembler reader: scale factor in references can also be a constant symbol, resolves #31165
git-svn-id: trunk@35473 -
2017-02-22 20:59:52 +00:00
maciej-izak
533c89e128 * New test for management operators to detect regressions like regression fixed in r35461 (many times initialized global variables)
git-svn-id: trunk@35463 -
2017-02-21 14:20:15 +00:00
florian
a80fcb74d8 * make test working for architectures with no float and ansistring support
git-svn-id: trunk@35460 -
2017-02-19 22:29:52 +00:00
maciej-izak
92c0e57c59 * Test suite for management operators. We have management operators on trunk! Enjoy ^^
git-svn-id: trunk@35452 -
2017-02-19 14:34:09 +00:00
florian
3d6d5145bf * fix handling of const string symbols in preprocessor expressions
+ accept string constants in preprocessor expressions, resolves #31246

git-svn-id: trunk@35432 -
2017-02-12 17:29:45 +00:00
Jonas Maebe
265c8e7bbc + support for specifying ms_abi_default, ms_abi_cdelc, sysv_abi_default, and
sysv_abi_cdecl calling conventions on x86-64 to force using the SYSV/
    Microsoft ABI on platforms that don't use it by default (mainly to ease
    porting pure assembler routines)

git-svn-id: trunk@35425 -
2017-02-11 19:57:12 +00:00
svenbarth
58abeb4a34 * also test IIDStr of raw interfaces
git-svn-id: trunk@35414 -
2017-02-10 16:06:47 +00:00
svenbarth
9ead39404b + print headers for the tested interfaces
git-svn-id: trunk@35413 -
2017-02-10 16:06:18 +00:00
svenbarth
6418f22ae0 * enable raw interface testing
git-svn-id: trunk@35412 -
2017-02-10 16:05:35 +00:00
maciej-izak
1d301b6dbe More consequent writing of Rtti. Part of code related to recorddef moved from recorddef_rtti to write_child_data_rtti(). When typeinfo is used in code init Rtti is a child of the full Rtti. Commit also contains correction for code commited for mantis #31249 (r35376) and mantis #31305 (r35377) for objects. Before was impossible to compile code with usage of typeinfo() function for object without managed fields ("Undefined symbol" error).
+ Test attached

git-svn-id: trunk@35403 -
2017-02-06 18:52:37 +00:00
florian
41b028ffc0 * unpcklp* require aligned memory, so do not spill replace their first operand by a memory location, resolves #31332
git-svn-id: trunk@35400 -
2017-02-05 20:59:54 +00:00
Jonas Maebe
6d5339cdb6 * CP819/IBM819 should be mapped to Windows code page 28591 (ISO8859-1)
(mantis #30639)

git-svn-id: trunk@35397 -
2017-02-04 22:44:36 +00:00
svenbarth
11493de99b + add test from Mantis #31305 for completeness sake
git-svn-id: trunk@35377 -
2017-01-31 18:24:00 +00:00
svenbarth
c1390b3442 * fix for Mantis #31249: applied (adjusted) patch provided by Maciej Izak
Commit message:
[PATCH] More consistent RTTI (also better performance) for classic
 objects (reference to initrtti from fullrtti).

git-svn-id: trunk@35376 -
2017-01-31 18:21:53 +00:00
svenbarth
c2d68e35b5 * also assume register calling convention for m68k
git-svn-id: trunk@35352 -
2017-01-28 14:55:41 +00:00
svenbarth
26135d605f + implement interface RTTI inspired by the changes from Steve Hildebrandt, yet not exactly the same. Like his implementation this one isn't Delphi compatible either.
+ added test

git-svn-id: trunk@35341 -
2017-01-27 17:00:15 +00:00
svenbarth
4742e826f6 + add test for Mantis #23702, just to be sure that we don't re-add that already solved problem
git-svn-id: trunk@35335 -
2017-01-27 13:58:54 +00:00
Jonas Maebe
048666a25c * when freeing a procdef that hasn't been registered for writing to the ppu
at the end of compiling a unit, also remove it from its owning procsym
    in case the procsym does get written to the ppu (possible because you
    can have extra overloads in the implementation) (mantis #25283)
   o also fixes webtbf/tw4103 on the platforms where this still failed
     (on the platforms where it worked, it worked by accedent since the
      compiler was accessing memory of a freed procdef)

git-svn-id: trunk@35309 -
2017-01-15 17:41:27 +00:00
Jonas Maebe
382bbc1201 - removed gotderef from valid_for_assign(), and return true at every place
where it used to be set to true (dereferencing a pointer always means
    that regardless of what the pointer was, the resut is assignable)
    (mantis #22979)
   o also removed gotpointer, since it was only used in combination with
     gotderef

git-svn-id: trunk@35308 -
2017-01-15 16:32:51 +00:00
svenbarth
fd465ff500 * adjusted tests as SizeOf(TParamFlags) = 1 does not need to be true anymore
git-svn-id: trunk@35264 -
2017-01-08 12:43:59 +00:00
svenbarth
25842d70c8 * adjust test so it also checks the full ParamFlags instead of only the reduced one
git-svn-id: trunk@35263 -
2017-01-08 12:42:17 +00:00
florian
1bea9e36eb + entropy test for random
git-svn-id: trunk@35260 -
2017-01-08 10:26:12 +00:00
florian
29a2c433f7 * -Sr option for iso mode: in case no command line parameter is passed, the file name for program parameters is derived from their variable name
git-svn-id: trunk@35257 -
2017-01-07 14:50:58 +00:00
svenbarth
6b641394d0 * fix for Mantis #31201: don't write any RTTI for undefined defs (and while we're at it abort if an error def is encountered)
+ added test

git-svn-id: trunk@35256 -
2017-01-07 14:35:25 +00:00
florian
3706ab4e44 * fix formatting of the writing of the fraction
git-svn-id: trunk@35235 -
2017-01-04 22:57:43 +00:00
svenbarth
150441627a + add test for Boolean RTTI
git-svn-id: trunk@35187 -
2016-12-23 16:05:57 +00:00
svenbarth
73ed1a9bf1 * fix for Mantis #31140: applied patch by Maciej Izak; this way it's clear what purpose ManagedFldCount has in FPC compared to Delphi
Commit message of patch:

+ New field TotalFieldCount for TTypeData
* Mark ManagedFldCount as deprecated
* Adjusted test trtti12.pp

git-svn-id: trunk@35180 -
2016-12-23 15:32:44 +00:00
svenbarth
8e765ef807 * extend test for 64-bit subranges
git-svn-id: trunk@35179 -
2016-12-23 15:11:38 +00:00
svenbarth
2acf542737 * extend TParamFlag by pfConstRef which is set for constref parameters
* extend test trtti9.pp accordingly

git-svn-id: trunk@35175 -
2016-12-20 21:37:07 +00:00
svenbarth
d34acf3bc7 * fix for Mantis #31120: check current_genericdef only if the current_procinfo isn't used
+ added test

Note: the test is added to webtbs although it's right now still failing, cause I'll remove the restriction for nested procedures since the compiler now supports them correctly. Due to the way we handle generics we don't have problems with them unlike Delphi.

git-svn-id: trunk@35147 -
2016-12-17 21:20:44 +00:00
svenbarth
a9d14fe30b * extend TOrdType by entries for 64-bit values
* have tkInt64 and tkQWord entries also contain the OrdType field (basically the compiler can now use the same function to generate them only with different type kinds)

+ added test

git-svn-id: trunk@35135 -
2016-12-16 14:22:04 +00:00
svenbarth
460f309035 * fix for Mantis #31123, applied patch by Maciej Izak
* adjusted test trtti10.pp due to renamed RecInitTable field

Original commit message:

Public interface for init table for records in TypInfo:

* Rename RecInitTable to RecInitInfo (because it is special kind of PTypeInfo for init table of record). Has more sense in practical usage.
+ New structure TRecInitData (and related PRecInitData) to handle data for (init) type info for records (aka init table)
+ New structure TInitManagedField and pointer type PInitManagedField (for init table)
+ Special helper property RecInitData to get PRecInitData for tkRecord

+ test attached

git-svn-id: trunk@35134 -
2016-12-16 13:43:12 +00:00
svenbarth
121a857af8 * fix for Mantis #31118: applied patch by Maciej Izak to fix usage of wrong variable
+ added test

git-svn-id: trunk@35133 -
2016-12-15 13:47:26 +00:00
svenbarth
12dba952f0 * integration of Part 2 patch of Mantis #30687 with a few adjustments:
- indentation in ncgrtti.pas
  - fewer ifdefs in rtti.inc
  - InitTable/Terminator field as first field to avoid padding on targets that require proper alignment and have SizeOf(Pointer) > 4

Original message by Maciej Izak:

Breaking change for rtti layout for record rtti. Init table
is always accessible from regular rtti. Rtti table contains indirect
reference to init table, additionally init table contains nil-terminator (for
rtl purposes - the only way to determine kind of info : init or rtti). Pros:

* will be possible to create more Delphi compatible code for RTTI, finally end-user can access to *real* managed fields of records (some work on TypInfo.pp is still required but is not necessary).
* important step forward for management operators (anyway this commit is not directly related to management operators)
* much more optimal memory allocation/initialization/finalization for records created/destroyed by InitializeArray/FinalizeArray, for example:

type
  TBar = record
    f1,f2,f3,f4,f5,f6,f7,f8,f9: byte;
    s: string;
  end;

previously:

  GetMem(PB, SizeOf(TBar));
  InitializeArray(PB, TypeInfo(TBar), 1); // FPC_INITIALIZE was executed 10 times

now:

  GetMem(PB, SizeOf(TBar));
  InitializeArray(PB, TypeInfo(TBar), 1); // FPC_INITIALIZE is executed just once

+ test attached

git-svn-id: trunk@35125 -
2016-12-13 23:03:11 +00:00
svenbarth
22e579cc74 * fix for Mantis #31107: disallow calling of ordinary record methods using the record's type.
git-svn-id: trunk@35113 -
2016-12-12 22:08:28 +00:00
Károly Balogh
442cbed9ad improved tb0625. boolean casting should disregard the upper bits
git-svn-id: trunk@35107 -
2016-12-11 13:26:04 +00:00
svenbarth
5fa181b5d9 * second fix for Mantis #31033: also check for df_specialization instead of is_specialization for parameters to correctly handle nested types that aren't really true specializations themselves
+ added additional test

git-svn-id: trunk@35103 -
2016-12-10 19:47:09 +00:00
svenbarth
0c372f0beb * fix compilation of Rtti unit on PowerPC: converting a Int64 to a Boolean failed (in this case with an internal error)
+ added a test though we should probably extend tcnvint2.pp to test converting ints to different sized boolean types...

git-svn-id: trunk@35101 -
2016-12-10 19:13:07 +00:00
svenbarth
f14759356f * regenerated Makefile after r35097
git-svn-id: trunk@35098 -
2016-12-09 20:48:34 +00:00
svenbarth
43d5dacf70 + add ability to execute tests that reside in $fpcdir/packages/*/tests
For now only rtl-objpas is used as the tests nevertheless need to adhere to the rules: t*.pp, ExitCode for result, no parameters

git-svn-id: trunk@35097 -
2016-12-09 20:48:11 +00:00
svenbarth
52673d34f1 * fix for Mantis #31033: don't check for is_specialization(), but for df_specialization (this way we also get pointers or nested types that aren't by themselves real specializations)
+ added test

git-svn-id: trunk@35092 -
2016-12-09 16:22:14 +00:00
Jonas Maebe
18077d9530 * when determining the best candidates for overloaded method calls, apply
the scope penalty relative to the nearest symtable that contains one of
    the applicable overloads, rather than relative to the nearest symtable
    that simply contains a method with this name (based on patch by
    Maciej Izak, mantis #25607)

git-svn-id: trunk@35089 -
2016-12-09 13:39:42 +00:00
sergei
8173efff3e * x86 asm reader: Don't copy operand size to instruction size for MOVSS and VMOVSS, because it is different for source and destination. Fixes breakage caused by fixing memory size of those instructions (Mantis #29954 and Mantis #29957).
+ Tests are extended to check that both OPR_LOCAL and OPR_REF memory operands compile without warnings as source and destination, in both Intel and AT&T syntax.

git-svn-id: trunk@35081 -
2016-12-07 14:08:28 +00:00
svenbarth
d499163ef5 * provisional fix for Mantis #31076: fail gracefully instead of with an internal error if a generic method is declared inside a generic class or record. This will change once we support nested generics however.
* adjusted error message to reflect that we're not only dealing with generic classes
+ added test; note: it's added in webtbs, cause the test will loose its %FAIL attribute in the future

git-svn-id: trunk@35079 -
2016-12-06 22:26:53 +00:00
svenbarth
70817baf98 * since we already allow inline specializations in mode ObjFPC due to generic functions it's only consequential to also allow specializations after pointers (they are already allowed in mode Delphi).
+ added tests
* tgeneric87.pp and tgeneric88.pp are no longer considered as tests that should fail

git-svn-id: trunk@35078 -
2016-12-06 21:37:22 +00:00
svenbarth
4fb77b71ec * fix for Mantis #31029, based on the patch provided by Silvio Clécio: PArrayOfByte is not necessary and in fact the purpose of TArrayOfByte is a different one from reference counting (namely to ensure correct passing of the parameter), so renamed accordingly (plus a comment); similar change in SetDynArrayProp. Also Get-/SetPropValue in Variants unit has been adjusted to make use of Get-/SetDynArrayProp.
+ added adjusted test

git-svn-id: trunk@35025 -
2016-11-30 19:32:41 +00:00
svenbarth
d9ea6aae4d * fix for Mantis #30761: always return the symbol found in the helper instead of doing this dependant on the presence of the overload attribute; for this the collection of all suitable overloads is done in tcallcandidates instead.
+ added test

git-svn-id: trunk@35024 -
2016-11-30 17:52:25 +00:00
svenbarth
6ba85c2a70 * second fix for Mantis #30626: also search in parent classes for a suitable pre-existing specialization
+ added test

git-svn-id: trunk@35014 -
2016-11-29 17:04:07 +00:00
svenbarth
ebfeb5b62a * fix for Mantis #30830: also remove unregistered specializations from the procsym's deflist when they're removed to avoid an access to freed data
+ added tests (adjusted original test plus a mode Delphi variant)

git-svn-id: trunk@35012 -
2016-11-29 14:12:02 +00:00
svenbarth
bfaa26d16a Commit r35010 also fixed Mantis #30524.
+ added tests

git-svn-id: trunk@35011 -
2016-11-28 18:37:20 +00:00
svenbarth
a535d54bcb * fix for Mantis #30939: Rework generation of the generic name to be less relying on the type hierarchy as a specialization inside the parameter declaration would want to have the full name of the procdef including its parameters, but those are still parsed at that stage (the pretty name is still a topic onto itself however...)
+ added tests (original test was only mode fpc, test for mode delphi is added as well)

git-svn-id: trunk@35010 -
2016-11-28 18:16:49 +00:00
svenbarth
3f77ce3b12 * leave parse_proc_head() (with some error recovery) if the interface could not be found instead of running straight into an access violation
+ added test

git-svn-id: trunk@35007 -
2016-11-28 17:54:48 +00:00
florian
7bb8873c83 * do not throw an internal error if in case of an previous error the parameter class of an errordef is requested, resolves #31016
git-svn-id: trunk@34984 -
2016-11-27 13:16:12 +00:00
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
florian
bfb6d4d1b7 * enable test to work also with small targets taking only a shortint as longjmp argument
git-svn-id: trunk@34972 -
2016-11-26 18:42:15 +00:00
florian
f66ee3628c * CPU bitness dependent counter sizes for faster testing on slow CPUs
git-svn-id: trunk@34959 -
2016-11-24 20:59:53 +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
sergei
133fcb5ab2 * Fixed VMOVQ instruction encoding, now assembles correctly also in 32-bit code.
+ Test

git-svn-id: trunk@34949 -
2016-11-21 13:59:44 +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
florian
0dbcd5daa9 * do not run test, if no stack checking is available
git-svn-id: trunk@34932 -
2016-11-20 16:02:37 +00:00
florian
13de8c6808 * -Or => -Ooregvar
git-svn-id: trunk@34931 -
2016-11-20 15:45:01 +00:00
florian
baa33d7e2f * pass enabled features to the compiler when running tests on the embedded target, so tests can depend on the features
git-svn-id: trunk@34929 -
2016-11-20 15:43:27 +00:00
Jonas Maebe
a89a4d905f + test for already fixed mantis #30948
git-svn-id: trunk@34928 -
2016-11-20 11:44:25 +00:00