Commit Graph

2283 Commits

Author SHA1 Message Date
nickysn
6f8abde786 + support [const+[ref]] in the x86 intel syntax asm reader
git-svn-id: trunk@38383 -
2018-02-28 16:24:45 +00:00
nickysn
8ffde52974 + also support [expr1]+[expr2] for adding references in the x86 intel syntax asm reader
git-svn-id: trunk@38381 -
2018-02-28 15:48:48 +00:00
svenbarth
332b078c22 * small extension of the test for completeness sake
git-svn-id: trunk@38369 -
2018-02-27 21:45:50 +00:00
florian
8c5606b41d + support mmx shifting
git-svn-id: trunk@38367 -
2018-02-27 21:40:12 +00:00
nickysn
9c814e42c9 + support segment overrides inside references (e.g. [es:bx]) in the x86 intel
syntax inline asm reader

git-svn-id: trunk@38365 -
2018-02-27 17:29:46 +00:00
nickysn
c4f66a2492 * fixed comment in test
git-svn-id: trunk@38356 -
2018-02-26 17:38:42 +00:00
nickysn
45fdd7655d + support concatenation of references in x86 intel syntax inline asm:
[expr1][expr2] = [expr1+expr2]
  [expr1[expr2]] = [expr1+expr2]
  This is compatible with TP7's inline asm, and perhaps also with tasm/masm/delphi.

git-svn-id: trunk@38352 -
2018-02-26 17:17:47 +00:00
nickysn
506d5fe30e + support bracketless references in the x86 intel syntax; ugly, but TP7 (and
perhaps also Delphi, TASM and MASM)-compatible

git-svn-id: trunk@38296 -
2018-02-20 17:18:09 +00:00
nickysn
8c99f3f70d + added tests tasm21a.pp and tasm21b.pp - same as tasm21.pp, but for i386 and x86_64
git-svn-id: trunk@38294 -
2018-02-20 16:06:29 +00:00
nickysn
cc3da0979e + extended test tasm21.pp, so it actually checks that the instructions it tests
do the right thing

git-svn-id: trunk@38293 -
2018-02-20 04:09:16 +00:00
nickysn
6c69e10613 + fix for using the function name (as the function's entry point address,
instead of the function result variable, which is already accessible, using
  the @Result directive) in inline asm

git-svn-id: trunk@38289 -
2018-02-19 18:04:00 +00:00
nickysn
81044b4cff + extended test tasm20.pp with a function, which checks that a shortstring
parameter doesn't get copied to a local variable in a pure asm routine

git-svn-id: trunk@38249 -
2018-02-16 15:27:52 +00:00
nickysn
1a57391e55 + extended test tasm20.pp with a function, that returns a shortstring (in that
particular case, it is allocated a @Result variable)

git-svn-id: trunk@38248 -
2018-02-16 15:02:06 +00:00
nickysn
f1b6be2d74 + only allocate a result variable for asm routines on i8086, if they are
returned in a parameter. This improves TP7 compatibility.

git-svn-id: trunk@38246 -
2018-02-15 17:51:03 +00:00
nickysn
b9e41330d4 + ensure the callee size paraloc info is available, when setting up a local var
or parameter in RAUtils.TOperand.SetupVar(). This fixes a compiler crash, when
  a parent parameter or local var is accessed (in certain ways) inside a nested
  inline asm routine.

git-svn-id: trunk@38236 -
2018-02-14 14:14:34 +00:00
nickysn
6c09394d35 + added test tasm18h.pp: same as tasm18.pp and tasm18g.pp, but for x86_64
git-svn-id: trunk@38232 -
2018-02-12 16:33:59 +00:00
nickysn
1857373c1b + added test tasm18g.pp, which is an i386 version of tasm18.pp
git-svn-id: trunk@38231 -
2018-02-12 16:14:21 +00:00
nickysn
f7ab96bbba * fixed program name in test tasm18f.pp
git-svn-id: trunk@38230 -
2018-02-12 15:46:17 +00:00
nickysn
34c9136283 + added tests, which check that 'test [reg+const*recordtype], 1' and
'test [reg+const*recordtype.recordfield], 1' produce an 'unable to determine
  operand size' error

git-svn-id: trunk@38229 -
2018-02-12 15:44:39 +00:00
nickysn
6fafac65fb + extended test tasm18.pp with instructions with a reference to a longint-sized
recordtype or recordtype.variable, but explicit 'byte ptr' or 'word ptr' type
  override

git-svn-id: trunk@38228 -
2018-02-12 15:34:08 +00:00
nickysn
b2b7d685a6 + extended test tasm18.pp with 32-bit instructions; this doesn't hurt TP7
compatibility, because TP7 produces an error (invalid combination of opcode
  and operands) in case of e.g.
  'test [di+rectype.longintfield], 1'; FPC instead generates:
  'test dword ptr [di+rectype.longintfield], 1' which is 386+, so whether it
  compiles depends on the asmcpu type.

git-svn-id: trunk@38226 -
2018-02-12 14:57:23 +00:00
florian
96ffb8abc9 + more tests
git-svn-id: trunk@38207 -
2018-02-11 17:50:40 +00:00
florian
31f78ea2b6 + implementation of the vectorcall calling convention by J. Gareth Moreton
+ tests

git-svn-id: trunk@38206 -
2018-02-11 17:50:37 +00:00
nickysn
f5e6b40486 + extended test tasm18.pp with recordtype*constant and
recordtype.recordfield*constant expressions in asm references

git-svn-id: trunk@38201 -
2018-02-11 03:43:31 +00:00
nickysn
a834e6d5c5 + added test tasm18b.pp, which is yet another for 3-byte records, which should
not set a valid operand size in the intel asm syntax mode. The difference
  with tasm18a.pp is, this one tests recordtype.a3bytefield, while tasm18a.pp
  tests a3byterecord directly.

git-svn-id: trunk@38199 -
2018-02-11 01:25:17 +00:00
florian
08ebf36d00 * fix test for i8086
git-svn-id: trunk@38192 -
2018-02-10 22:19:59 +00:00
nickysn
3e63f6bbae + added test tasm18a.pp, which tests that 3-byte records don't set a valid
operand size in the intel asm syntax mode. In other words, this is not valid:
    test [di + a3byterecordtype], 1

git-svn-id: trunk@38190 -
2018-02-10 16:27:48 +00:00
nickysn
d5845a2d2a * updated test tasm18.pp, so it is now runnable and checks the generated code
git-svn-id: trunk@38188 -
2018-02-10 12:34:03 +00:00
nickysn
cbf01fc284 + added test tasm18.pp, which tests instructions with an operand size set
implicitly by a recordtype.recordfield or recordtype constant; test is
  i8086-only and NORUN for now, but will be updated later, to actually test the
  generated code as well (and more tests will be added for i386 and x86_64 as
  well)

git-svn-id: trunk@38177 -
2018-02-09 17:54:47 +00:00
nickysn
391f85f828 + for TP7 compatibility, allow the '&', '$' and '?' characters in the x86 intel
syntax inline asm reader

git-svn-id: trunk@38167 -
2018-02-08 16:54:33 +00:00
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
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
f61b074912 * (re)store alignment when doing a $push/$pop
git-svn-id: trunk@38020 -
2018-01-22 21:06:07 +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
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
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
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
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
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
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
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
florian
01b950f39b + new test
git-svn-id: trunk@37170 -
2017-09-10 18:07:15 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Tomas Hajny
ff02b2dfb5 + added test based on bug #24504
git-svn-id: trunk@34850 -
2016-11-08 22:24:22 +00:00
florian
a27b07b342 + more restrictions on pred/succ to dec/inc optimization
o check if the argument can be used as a call by reference parameter
  o check if the argument has no side-effects
+ tests

git-svn-id: trunk@34816 -
2016-11-06 16:36:02 +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
9c81e90e08 + extension to iso mode: reset/rewrite can take a file name as a second parameter
git-svn-id: trunk@34726 -
2016-10-16 07:55:08 +00:00
Jonas Maebe
265923a2ee * several fixes for TMultiReadExclusiveWriteSynchronizer, based on patch by
Derek (mantis #28830)
   o ability for a thread to acquire a readlock when it already holds a
     write lock, or vice versa
   o detect when thread1 releases a lock while it hadn't acquired one
   o correct result of beginwrite (return true only when another thread
     held/acquired a write lock before the current thread got it)
   o extra compared to Derek's patch: replaced some additional
     (mostly pre-existing) interlocked*() hacks with proper memory
     barriers, made formatting consistent, fixed compilation on platforms
     where tthreadid is not an integer type, improved tthreadid hashing
     function for 64 bit platforms, fixed some comments

git-svn-id: trunk@34678 -
2016-10-08 20:45:45 +00:00
Jonas Maebe
e5a1231931 * updated FSF address (mantis #30198, patch by Paul Gevers)
git-svn-id: trunk@34598 -
2016-10-02 12:56:59 +00:00
svenbarth
246de84ef3 * ensure that a finalization section is parsed before the generation of specializations as otherwise specializations in such sections would result in unresolved forward declarations
git-svn-id: trunk@34582 -
2016-09-30 15:41:35 +00:00
Jonas Maebe
775f86d216 * made cthreads the first unit, as the initialisation code of sysutils now
apparently already triggers threading-related code

git-svn-id: trunk@34516 -
2016-09-11 18:17:41 +00:00
svenbarth
6b93f09567 * fix test
git-svn-id: trunk@34458 -
2016-09-08 17:43:04 +00:00
svenbarth
26a2ddd3d6 + extend Delete() intrinsics with Delphi compatible support for dynamic arrays. Also fixes Mantis #30306
git-svn-id: trunk@34455 -
2016-09-08 17:15:10 +00:00
Jonas Maebe
2d051f89f7 * don't increase refcounts for variants assigned to (ti_)const nodes, fixes
memory leak after r34288 and should have been done as part of r34287
    (mantis #30546)

git-svn-id: trunk@34440 -
2016-09-06 21:28:34 +00:00
svenbarth
8b853571c6 * don't generate a warning if a "generic" token follows while parsing procedure directives (let's hope we'll never have to add a "generic" directive :/ )
+ added test

git-svn-id: trunk@34343 -
2016-08-19 14:07:36 +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
pierre
d957595842 Fix for msdos, local variable SaveExit must be a CodePointer
git-svn-id: trunk@34267 -
2016-08-10 16:16:17 +00:00
pierre
4b17961dd4 * Skip some tests for msdos
git-svn-id: trunk@34266 -
2016-08-10 16:10:25 +00:00
yury
f08d136290 * Fixed test for non-Windows targets.
git-svn-id: trunk@34236 -
2016-07-30 16:37:47 +00:00
yury
980c4741ac * Fixed conversion from PWideChar to ansistring.
+ test. 

git-svn-id: trunk@34219 -
2016-07-29 09:43:05 +00:00
pierre
e9a1ed9446 Add fpwidestring and unicodeducet units for go32v2 tests related to unicode support
git-svn-id: trunk@34168 -
2016-07-22 06:26:17 +00:00
pierre
d4945f4fd0 Avoid range check error for Win64 by correcting type of parameters for GetModuleFileNameA WinAPI function
git-svn-id: trunk@34148 -
2016-07-19 11:35:21 +00:00
pierre
d1a610a2fc Avoid range check error on win64 target in comparison of THandle to -1
git-svn-id: trunk@34147 -
2016-07-19 09:48:34 +00:00
pierre
ffe2940b01 Fix test for compact and medium i8086 memory model
git-svn-id: trunk@34073 -
2016-07-05 22:32:19 +00:00
pierre
bc839068de Fix test for compact and medium i8086 memory model
git-svn-id: trunk@34072 -
2016-07-05 22:30:12 +00:00
pierre
360f2734eb Improve targ1a and targ1b to really check content of args passed to called executable
git-svn-id: trunk@34067 -
2016-07-04 21:03:40 +00:00
pierre
1cbc526501 Reduce NumIterations for I8086 cpu to avoid timeout
git-svn-id: trunk@34052 -
2016-07-03 07:45:45 +00:00
pierre
16477c598d Fix huge memory model failure by adding nostackframe modifier needed to avoid DS reloading at proc entry
git-svn-id: trunk@34049 -
2016-07-02 15:12:18 +00:00
pierre
ef6a8009cf Add {$goto on} for FPC to avoid compile time error
git-svn-id: trunk@34048 -
2016-07-02 15:10:51 +00:00
pierre
2ca06538d6 Limit alignment requirement for I8086 CPU to 2 even if pointer is 4 byte long
git-svn-id: trunk@34047 -
2016-07-02 14:58:49 +00:00
pierre
d2113f5ead Use SizeInt type for DoMem variable argument, as it might be different from PtrInt, for instance for some msdos memory models
git-svn-id: trunk@34021 -
2016-06-28 15:59:09 +00:00
pierre
dfeadf89e9 Modify test to take into account the specific prologue for Huge model
git-svn-id: trunk@34016 -
2016-06-24 15:13:37 +00:00
pierre
f079701302 Also disable range check error that can happen on 64-bit processors
git-svn-id: trunk@34011 -
2016-06-21 08:02:19 +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
pierre
27119cad3c Disable range checks explicitly as THandle is unsigned at least for win32 OS
git-svn-id: trunk@34009 -
2016-06-20 15:26:50 +00:00
Jonas Maebe
580cf73e64 * align the variables passed to InterlockedCompareExchange128() to a
multiple of 16 bytes

git-svn-id: trunk@33962 -
2016-06-12 09:21:08 +00:00
Jonas Maebe
5af40f22e8 * handle enums with a packenum setting that is larger than necessary to store
all of their values, when kept in a bitpacked array, properly via
    pass_typecheck rather than hacking location.size in pass_generate_code:
   o the old fix was incomplete (it didn't handle non-constant indices)
   o the old fix didn't work for llvm (since it uses defs rather than
     location.size)

git-svn-id: trunk@33943 -
2016-06-09 22:00:14 +00:00
svenbarth
f27ce0b159 Rework the way the method bodies for specializations are generated: instead of walking the global and local symboltable all pending specializations are kept in a list of the current module which is (for now) walked at the end of a unit/program to generate the method bodies as before.
fmodule.pas, tmodule:
  + new list pendingspecializations which keeps track of all pending specializations of the current module
psub.pas:
  * move generate_specialization_procs and related routines to pgenutil
  + new procedure read_proc_body to read a routine's body, cause generate_specialization_procs needs it (unlike the already existing overload in the implementation section, this one can only handle bodies of non-nested routines) 
pgenutil.pas:
  * generate_specialization_phase2: add the newly specialized generic to the current module's pending specializations
  * generate_specialization_procs: reworked so that it uses the new pendingspecializations field instead of walking the global and local symboltable of the current unit
pmodules.pas:
  + add pgenutil to uses due to the moved generate_specialization_procs

+ added test

git-svn-id: trunk@33826 -
2016-05-26 18:56:16 +00:00
pierre
345361beef Revert commit 33771 and directly replace cpu8086 by cpui8086 which is always defined by ppc8086 compiler
git-svn-id: trunk@33773 -
2016-05-24 06:52:17 +00:00
pierre
ba509152b8 Also define CPUSMALL macro if CPUI8086 is defined
git-svn-id: trunk@33771 -
2016-05-23 21:07:11 +00:00
pierre
6646a0d29f Correct tseg.pp test for i8086 CPPU for which seg/cseg/dseg/sseg should NOT return zero values
git-svn-id: trunk@33770 -
2016-05-23 20:58:37 +00:00
pierre
74b3481918 Use small number for Blocks constant for i8086 CPU also
git-svn-id: trunk@33769 -
2016-05-23 20:51:07 +00:00
nickysn
bffe9480f4 + added the winapi functions, structures and constants for raw keyboard and mouse input
git-svn-id: trunk@33746 -
2016-05-22 01:59:27 +00:00
Jonas Maebe
f0753d85ad * fix the Upgrade to Unicode version 7 and CLDR 27 from r32814
(mantis #29659, fixes tuca* tests)

git-svn-id: trunk@33708 -
2016-05-19 15:44:22 +00:00
michael
8e75ac64f1 * Patch from Graeme GeldenHuys to implement UnicodeString versions of MatchStr() and IndexStr() (bug ID 30113)
git-svn-id: trunk@33700 -
2016-05-16 16:40:27 +00:00
yury
511f5b5ded * trwsync test: Increased timeout to 60 seconds. Trying to fix random failures due to the timeout on busy machines.
git-svn-id: trunk@33487 -
2016-04-12 08:38:18 +00:00
yury
a37cd66a87 * trwsync test: Increased timeout to 30 seconds. Should prevent failures on busy machines.
git-svn-id: trunk@33313 -
2016-03-22 10:16:25 +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
yury
d43e5dcab8 * tests: Fixed string comparison.
git-svn-id: trunk@33302 -
2016-03-20 21:25:18 +00:00
nickysn
759a4f8258 * don't try to build lnfodwrf on i8086-msdos, because it causes internal error
200309041 and thus breaks building i8086-msdos snapshots entirely. Added test
  that reproduces the bug in a small program, so it can be fixed eventually.

git-svn-id: trunk@33276 -
2016-03-18 19:56:37 +00:00
Jonas Maebe
2b210335a1 * fixed pointer arithmetic errors in WideStrAlloc/StrBufSize/StrDispose
(patch by Iks, mantis #29710)

git-svn-id: trunk@33271 -
2016-03-18 13:12:11 +00:00
Jonas Maebe
697aed738c * replaced test directory names with ones that doesn't contain decomposable
characters, so the test's success doesn't depend on getdir returning a
    string using the same composition as the used name (fixes test on
    OS X 10.11)

git-svn-id: trunk@33270 -
2016-03-18 12:43:47 +00:00
Jonas Maebe
5919ca84bb * fixed string code page after setstring(rawbytestring,..) (mantis #29833)
git-svn-id: trunk@33268 -
2016-03-18 12:43:42 +00:00
florian
45807056c5 * factored out SymbolCandidateForWarningOrHint
* do not issue a hint if a normal parameter is passed to another procedure by var
+ test

git-svn-id: trunk@33248 -
2016-03-13 19:14:26 +00:00
florian
234990b73c + fma test program extended to support arm
git-svn-id: trunk@33185 -
2016-03-06 13:33:22 +00:00
Jonas Maebe
87f46dcafd * updated pos() for Java with an offset parameter (equivalent of r31464 etc)
(mantis #29626)

git-svn-id: trunk@33160 -
2016-03-05 15:32:25 +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
8775897621 * fix copy & paste error (didn't influence the test as str3 isn't changed, but at least it's consistent that way...)
git-svn-id: trunk@33090 -
2016-02-12 16:09:32 +00:00
svenbarth
8287773b16 Reverted revision 33036. This feature is too controverse to be left in.
git-svn-id: trunk@33048 -
2016-02-04 19:26:51 +00:00
svenbarth
ed94ca4b24 Add support for IfThen() instrinsic that works like the if-statement in that it evaluates only the expression that is indeed executed.
The result type of the intrinsic is determined by the Then-expression to provide a bit of control. There might however be some situations in which this fails, for this exceptions need to be added (e.g. a constant string needs to be converted to a normal string).

compinnr.inc:
  + add new constant in_ifthen_x_y_z for the IfThen() intrinsic
psystem.pas: 
  + create_intern_symbols: add symbol for IfThen() intrinsic
pexpr.pas:
  * statement_syssym: parse parameters of IfThen() intrinsic and return corresponding inline node
ninl.pas, tinlinenode:
  + new method handle_ifthen() which converts the inline node to an if-node which assigns the expressions to a temp node that is returned
  * pass_typecheck: handle in_ifthen_x_y_z using handle_ifthen()
  * pass_1: in_ifthen_x_y_z does not need a first pass as it's already converted after the typecheck pass

+ added tests

git-svn-id: trunk@33036 -
2016-01-31 14:29:12 +00:00
pierre
3300f51ed6 * Adjust test for win64
git-svn-id: trunk@32957 -
2016-01-16 01:15:40 +00:00