Commit Graph

744 Commits

Author SHA1 Message Date
Yuriy Sydorov
16d17de1ff + Added a test for a bug fixed in b96057ad. 2021-09-06 19:01:34 +03:00
florian
9969da24e1 * { ... } is no a longer valid comment in aarch64 assembler
git-svn-id: trunk@49215 -
2021-04-17 11:14:37 +00:00
Jonas Maebe
3e047d3691 * generate more efficient code for trunc(currency), trunc(comp), and
round(comp) on platforms where currency and comp are handled using the FPU
   o also fixes trunc(comp) and trunc(currency) compilation for x86 on LLVM
     with -Oofastmath
 * add missing removal of excess fpu precision typecasts for trunc/round

git-svn-id: trunk@47854 -
2020-12-27 13:18:47 +00:00
florian
33afecd117 + support got modifier on labels
git-svn-id: trunk@47851 -
2020-12-26 18:51:45 +00:00
svenbarth
32938dde1c * apply patch by Blaise.ru to allow record methods to be assigned to method variables as well (this is Delphi compatible)
+ added test

git-svn-id: trunk@47794 -
2020-12-16 21:43:25 +00:00
florian
792b629aa6 + -Xa option: generate code which allows to use more than 2 GB of static data on 64 Bit targets
+ implemented support for x86-64
  * more than 2 GB static data requires to use the --no-relax option on linux

git-svn-id: trunk@47651 -
2020-11-30 22:07:34 +00:00
svenbarth
903486642e * allow an integer expression for SetPeFlags and SetPeOptFlags (Delphi compatible)
* adjusted test to check that as well

git-svn-id: trunk@47602 -
2020-11-26 20:13:40 +00:00
svenbarth
eb7158d250 * ensure that internal method names (namely operator overloads and class con-/destructors) result in different mangled names from ordinary methods even if they should be converted to lowercase (which happens for section names)
+ added tests

git-svn-id: trunk@47110 -
2020-10-14 09:11:44 +00:00
svenbarth
2f877218b4 * fix test: TThread.WaitFor calls CheckSynchronize as well, so the thread needs to signal when it's done with removing entries from the queue
git-svn-id: trunk@47084 -
2020-10-11 12:38:16 +00:00
florian
284aca7348 + x86: FstpFld2Fst optimization (re-enabled for safe cases)
git-svn-id: trunk@47024 -
2020-09-30 19:20:14 +00:00
svenbarth
a624348692 * when removing a method from the synchronization queue using TThread.RemoveQueuedEvent then both the Code and the Data need to match (Delphi does the same)
+ added test

git-svn-id: trunk@47007 -
2020-09-29 17:34:26 +00:00
svenbarth
cce2dad1bf * fix for Mantis #37806: allow undefineddefs for Include() and Exclude()
+ added tests

git-svn-id: trunk@46953 -
2020-09-25 14:13:53 +00:00
Jonas Maebe
0904ea0c3f * added missing "end." (fixup for r46904)
git-svn-id: trunk@46906 -
2020-09-20 12:43:49 +00:00
Jonas Maebe
9f42931eeb * don't print range check warnings when evaluating inlined explicit typecasts
git-svn-id: trunk@46904 -
2020-09-20 10:29:51 +00:00
svenbarth
9d86fed95b * avoid range check error when using SwapEndian with 16-bit constants
+ added test

git-svn-id: trunk@46897 -
2020-09-19 17:04:17 +00:00
yury
2ab7cceeaa * Added the $F+ switch (forced far calls) for some TP mode tests.
git-svn-id: trunk@46456 -
2020-08-16 10:48:10 +00:00
pierre
9f60f5093d F_GetLk/SetLk have different values for sparc/sparc64
git-svn-id: trunk@45829 -
2020-07-22 23:15:03 +00:00
svenbarth
52678562e3 * correctly handle selection between Single and Double overloads for Currency
+ added test

git-svn-id: trunk@45707 -
2020-06-27 22:33:36 +00:00
svenbarth
febeef03e4 * for adding procdefs to forwarddefs check for the specialization flag instead of whether it's a full specialization; fixes implicit finalization handlers on x86_64-win64 not being found
+ added tests

git-svn-id: trunk@45646 -
2020-06-13 18:42:31 +00:00
yury
c1d124d497 * x86: Fixed peephole optimization introduced in r44233. tb0219 and tb0548 tests have failed with -O2 since then.
* Added variants of the tb0219 and tb0548 tests with forced -O2.

git-svn-id: trunk@45291 -
2020-05-06 14:18:44 +00:00
svenbarth
3d2945726a * handle generic parameters in Ord()
+ added test

git-svn-id: trunk@45232 -
2020-05-03 15:08:31 +00:00
florian
b6097a0300 * correctly handle result type of string constant nodes for internally created
nodes

git-svn-id: trunk@45231 -
2020-05-03 12:41:17 +00:00
svenbarth
bd01182ff0 * add support for AND, OR, XOR and NOT of integer values in preprocessor directives (Delphi allows that as well)
+ added test

git-svn-id: trunk@45053 -
2020-04-24 14:09:04 +00:00
svenbarth
5ef9a78f5f * fix for Mantis #36951: B and BL can take immediate literals as well
+ added test

git-svn-id: trunk@44999 -
2020-04-22 20:19:14 +00:00
florian
66aa2e1416 * fixed tests for architectures with FPC_COMP_IS_INT64 defined
git-svn-id: trunk@44222 -
2020-02-20 20:51:46 +00:00
svenbarth
c4f3f7f453 * only resolve a dummy symbol if it is a type symbol (thus truly a dummy symbol)
+ added tests

git-svn-id: trunk@44172 -
2020-02-14 16:49:07 +00:00
svenbarth
9a42625cfb * also allow by-value open array parameters for the tail recursion optimization
* adjusted test

git-svn-id: trunk@44012 -
2020-01-21 21:30:10 +00:00
svenbarth
4fc02d3d09 * enable tail recursion optimization also for const and constref open arrays
+ added test

git-svn-id: trunk@44011 -
2020-01-21 21:29:56 +00:00
svenbarth
3e7dc25667 * fix for Mantis #36496: correctly handle the function result alias variable inside generic functions
+ added tests

git-svn-id: trunk@43823 -
2019-12-30 21:35:26 +00:00
svenbarth
ef6c9e930b * correctly handle the genericdef being a procdef, otherwise no code will be generated (and no error either :/ )
+ added test

git-svn-id: trunk@43586 -
2019-11-25 20:28:23 +00:00
svenbarth
39f4b97ea5 + add test for a problem reported by Michael van Canneyt which is fixed by the previous revision
git-svn-id: trunk@43569 -
2019-11-24 00:04:35 +00:00
florian
3de38c4894 * naming of tests fixed
git-svn-id: trunk@43502 -
2019-11-16 17:18:04 +00:00
florian
60b3296594 * relax conditions in tcallnode.optimize_funcret_assignment, resolves #36279
git-svn-id: trunk@43501 -
2019-11-16 17:16:16 +00:00
svenbarth
b4e998b3f8 + add tests to check for correct definition of the FPC_* mode defines
git-svn-id: trunk@43115 -
2019-10-03 12:34:42 +00:00
Jonas Maebe
9b70c7623d * initialise local variable to prevent random failures
git-svn-id: trunk@42992 -
2019-09-14 07:30:38 +00:00
Jonas Maebe
ce598c15ec * factored out the conditions under which add nodes need to perform
overflow checks
   o in particular ensure that cpu-specific overrides don't perform overflow
     checks when nf_internal is set

git-svn-id: trunk@42573 -
2019-08-03 12:19:50 +00:00
Jonas Maebe
15532e5277 * disabled low-level hack test for LLVM
git-svn-id: trunk@42102 -
2019-05-19 19:20:38 +00:00
svenbarth
b7a716cd81 * correct return a pointer to the list so that List^[x] works as it did before 3.2
+ added test

git-svn-id: trunk@41938 -
2019-04-26 08:13:11 +00:00
svenbarth
307ff071e6 * allow any untyped parameter to be passed to a untyped constref parameter
+ added test

git-svn-id: trunk@41829 -
2019-04-04 19:31:55 +00:00
svenbarth
9a9c6a3ff4 * fix for Mantis #35150: correctly convert Int64/QWord values to OleVariant (Delphi compatible)
+ added test

git-svn-id: trunk@41571 -
2019-03-03 14:50:09 +00:00
Jonas Maebe
7b313a2c15 * stop searching for methods to implement interfaces in parent classes after
encountering a method with the correct name that does not have the
    "overload" directive (same logic as when looking for a call candidate,
    to avoid errors when using a Pascal-level wrapper to call interface
    methods, and Delphi-compatible since it always required "overload" for
    overloaded methods)
   o also catches calling convention mismatches like in webtbs/tw27349

git-svn-id: trunk@40683 -
2018-12-28 18:25:58 +00:00
Jonas Maebe
c6bb85eae9 * support for compiling the objects unit methods that expect local procedure/
function pointers using {$modeswitch nestedprocvars} functionality, activate
    this for LLVM and also activate that modeswitch for a test that uses this
   o also convert the IDE units to use this functionality
   o requires extra typecasts because implicit type conversions from
     procvar(p: psometype) to procvar(p: pointer) are not supported; on the
     plus side, even those type conversions are checked for validity
   o note: requires {$modeswitch nestedprocvars} in all programs/units
     that rely on this functionality

git-svn-id: trunk@40598 -
2018-12-20 21:22:40 +00:00
pierre
e7aadde92f Modify tbs/tb0588.pp to check that a warning is issued about non-initialized return value, moved to tbf directory
git-svn-id: trunk@40521 -
2018-12-11 08:47:59 +00:00
yury
4682ac269d * Further improvement for r40180:
An uninitialized function Result of a managed type needs special handling.
    When passing it as a var parameter a warning need to be emitted, since a user
    may expect Result to be empty (nil) by default as it happens with local vars
    of a managed type. But this is not true for Result and may lead to serious issues.

    The only exception is SetLength(Result, ?) for a string Result. A user always
    expects undefined contents of the string after calling SetLength(). In such
    case a hint need to be emitted.
+ Tests for this.

git-svn-id: trunk@40216 -
2018-11-04 15:37:52 +00:00
florian
352fb866ef * is_range_test returns false if "lower" bound is greater than "upper" bound
git-svn-id: trunk@39837 -
2018-09-27 20:24:52 +00:00
florian
a34d4e715c Merged riscv_new branch
git-svn-id: trunk@39813 -
2018-09-26 19:49:08 +00:00
svenbarth
06267006f3 * explicitely handle the boolean types to determine the bit size as all of them have the bit size 1
+ added test

git-svn-id: trunk@39786 -
2018-09-21 13:24:49 +00:00
Jeppe Johansen
74a7963d58 Redo overflow checking code.
Fix shift operators in case of unsigned subreg operations. There should be no sign extension here.
Add some unittest implementations that test stack execution and writing to readonly constants.

git-svn-id: branches/laksen/riscv_new@39762 -
2018-09-16 18:37:59 +00:00
Jeppe Johansen
fb0ef295f1 Fixed unittests that needed arch specific inline assembler.
git-svn-id: branches/laksen/riscv_new@39716 -
2018-09-09 09:18:58 +00:00
svenbarth
072699d38a * protect the destructors of tabstractrecordsymtable and twithsymtable against executing when called with a refcount > 1 (this fixes Mantis #34210)
+ added simplified test

git-svn-id: trunk@39693 -
2018-08-31 19:16:45 +00:00
florian
6b9f52b4f2 + couple of { %OPT=-CE } to tests added
git-svn-id: branches/laksen/riscv_new@39641 -
2018-08-19 12:42:26 +00:00
svenbarth
32c307e9ce * fix for Mantis #34021: if one of the two operators is an array constructor try to use an operator overload for that first before converting it to a set
+ added tests

git-svn-id: trunk@39554 -
2018-08-03 15:24:59 +00:00
florian
0c6cf12fbf + support for the directive $EXCESSPRECISION
git-svn-id: trunk@39443 -
2018-07-12 21:39:50 +00:00
nickysn
e813a11e85 + support TP7-compatible @proc^ (as in FillChar(@proc^,...))
git-svn-id: trunk@39343 -
2018-06-29 14:16:35 +00:00
svenbarth
ff407c56d9 * extend scanning of $modeswitch to support not only + and -, but also ON and OFF like other switches
+ added tests

git-svn-id: trunk@39280 -
2018-06-22 21:29:08 +00:00
pierre
e518bd52ba Explicitly disabled overflow and range check for these two tests
git-svn-id: trunk@39266 -
2018-06-21 04:52:37 +00:00
svenbarth
7990b2e3f3 * apply patch from J. Gareth Moreton to implement Int() for SSE (currently only used on Win64)
+ added test

git-svn-id: trunk@38993 -
2018-05-14 21:08:04 +00:00
pierre
f28ab34f06 unicodeducet must appear before fpwidestring to set current_collation at startup
git-svn-id: trunk@38962 -
2018-05-09 23:11:48 +00:00
svenbarth
abd893cac4 * fix for Mantis #33635: correctly working SSE2 based Frac() implementation by J. Gareth Moreton
+ added test

git-svn-id: trunk@38903 -
2018-05-04 15:44:40 +00:00
svenbarth
cfa373a8cf * fix case of string with ranges as labels
+ add test

git-svn-id: trunk@38860 -
2018-04-27 21:06:33 +00:00
pierre
4a2348a38b skip targets that do not support libraries
git-svn-id: trunk@38772 -
2018-04-14 16:09:50 +00:00
pierre
ab7fb33d67 Restore removed ifdef UNIX around iosxwstr/cwstring unit loading
git-svn-id: trunk@38763 -
2018-04-13 06:22:21 +00:00
pierre
52b830a434 Use USE_INTERNAL_UNICODE to be able to test fpwidestrings on different targets
git-svn-id: trunk@38757 -
2018-04-12 20:39:34 +00:00
pierre
e69a7489d9 Add wide string needed units for go32v2 or darwin
git-svn-id: trunk@38736 -
2018-04-12 10:07:16 +00:00
pierre
4cf1ac209a Add %skiptarget=$nothread to tests using threads
git-svn-id: trunk@38528 -
2018-03-15 09:05:26 +00:00
pierre
cc22913a4c Modify DoMem parameter type to SizeUInt and adapt tests using this function, to avoid run time errors with range check
git-svn-id: trunk@38521 -
2018-03-13 21:59:58 +00:00
florian
61053ead34 + optimize is operator if used on sealed classes as proposed in #30097
git-svn-id: trunk@38387 -
2018-02-28 22:09:24 +00:00
florian
70519c0837 * do not use crt by default, reduced wrong fails hopefully
git-svn-id: trunk@38345 -
2018-02-25 15:34:15 +00:00
florian
8731854165 * test code for avr assembler by Christo Crause
* fix size of val field in TOprRec for avr, resolves #32946

git-svn-id: trunk@38291 -
2018-02-19 21:23:28 +00:00
florian
6400d612e8 + seg(<procvardef>) returns the segment stored in the procedure variable
git-svn-id: trunk@38216 -
2018-02-11 22:26:01 +00:00
florian
e5ebc65cce * if si and di are allocated on i8086, using an index in references is not possible anymore
git-svn-id: trunk@38203 -
2018-02-11 15:54:37 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
marco
690f784c4d * enable 40+ tests for Haiku as per mantis #30470
git-svn-id: trunk@34312 -
2016-08-14 14:09:24 +00:00
Jonas Maebe
051317e82e * load the function result from the parentfpstruct to its original location
in exit nodes, because the wrapping code added in
    tnodeutils.wrap_proc_body() gets inserted before the exit label to which
    the exit node jumps

git-svn-id: trunk@34305 -
2016-08-13 14:47:50 +00:00
pierre
358eb38ef2 * fix test for msdos compact mode
git-svn-id: trunk@34268 -
2016-08-10 16:25:42 +00:00
Jonas Maebe
630033c9fa * fixed compilation on platforms where comp=int64 (should maybe fix the
compiler to support assigning integral floating point constants to
    comp on all platforms)

git-svn-id: trunk@34082 -
2016-07-06 17:28:08 +00:00
pierre
b238b3cb8d Fix test for compact and medium i8086 memory model
git-svn-id: trunk@34074 -
2016-07-05 22:42:38 +00:00
Jonas Maebe
ec5dea1092 * don't perform the "/ const" to "* (1/const)" transformation for comp-typed
expressions, since comp cannot represent fractions (bug reported at
    http://lists.freepascal.org/pipermail/fpc-pascal/2016-June/048234.html )

git-svn-id: trunk@34035 -
2016-06-30 15:33:51 +00:00
pierre
8058f6b301 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@34022 -
2016-06-28 16:13:24 +00:00
pierre
3253711e95 Disable expliccitly overlfow and range checks
git-svn-id: trunk@34014 -
2016-06-21 09:21:18 +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