Commit Graph

2283 Commits

Author SHA1 Message Date
pierre
238040afdd * Fix compilation for JVM cpu
git-svn-id: trunk@32956 -
2016-01-16 01:15:12 +00:00
Jonas Maebe
cc197a5593 * extended test
git-svn-id: trunk@32900 -
2016-01-10 14:01:32 +00:00
pierre
de7a79f497 Use SizeInt type for GlobalStartMem and StartMem variables to avoid compilation error for msdos compact memory model
git-svn-id: trunk@32874 -
2016-01-07 17:33:36 +00:00
pierre
80a7b909e4 Add $goto on for FPC compilation to avoid compile time error
git-svn-id: trunk@32873 -
2016-01-07 17:12:13 +00:00
florian
b7786d0849 * fix test parameter
git-svn-id: trunk@32793 -
2015-12-29 21:12:28 +00:00
florian
a03d992cc0 * doing fastmath is not useful when testing currency calculation accuracy (test fails with fastmath enabled on some targets)
git-svn-id: trunk@32790 -
2015-12-29 15:22:55 +00:00
michael
464e40bfd9 * Applies patch from Laco (bug ID 29113)
git-svn-id: trunk@32723 -
2015-12-26 11:27:13 +00:00
Jonas Maebe
c4b347c271 * support anonymous procvar definitions for jvm outside parameter lists (in a
parameter list they represent nested procvars, which aren't supported yet)

git-svn-id: trunk@32454 -
2015-11-22 10:52:20 +00:00
svenbarth
1d72397c19 Add tests for generic functions/procedures/methods
git-svn-id: trunk@32440 -
2015-11-21 16:53:11 +00:00
michael
13cfc4ac8f * Added test for NormalizedBCD
git-svn-id: trunk@32358 -
2015-11-18 14:39:29 +00:00
nickysn
a19c506b46 + added a very simple test for i8086-msdos for linking an external TASM
assembler .obj module. Note that TASM modules aren't fully supported yet,
  because our OMF internal linker doesn't support all features of the OMF object
  format. This test works, because it's really simple. As more OMF features are
  supported, this test will be extended.

git-svn-id: trunk@32353 -
2015-11-17 17:08:25 +00:00
michael
dfedc081e0 * Test for scandatetime (bug ID 28952)
git-svn-id: trunk@32347 -
2015-11-16 19:51:14 +00:00
florian
70b8789262 o basic extended pascal support:
+ automatically loaded helper unit
  * Makefiles adapted
  * mode switch
  * mode switches reorganized
+ TimeStamp support

git-svn-id: trunk@32330 -
2015-11-15 15:13:36 +00:00
nickysn
1e7a0838d7 + added test for the 'SEG @CODE' and 'SEG @DATA' i8086 inline assembler directives
git-svn-id: trunk@32284 -
2015-11-10 21:21:17 +00:00
nickysn
8c81e93a96 * replaced setintvec(x,@proc) in i8086 tests with the memory model independent version setintvec(x,ptr(seg(proc),ofs(proc)))
git-svn-id: trunk@32249 -
2015-11-05 14:18:55 +00:00
nickysn
c25585daee * fixed addr(procedure), mantis #28775
git-svn-id: trunk@32204 -
2015-10-30 15:17:48 +00:00
nickysn
500743c65d + extended test with many more reference syntaxes, accepted by TP7
git-svn-id: trunk@32190 -
2015-10-29 15:48:18 +00:00
nickysn
1eaa77d2f9 + added test for i8086 inline asm access to procedure data
git-svn-id: trunk@32186 -
2015-10-29 14:47:26 +00:00
nickysn
ce7672b750 + added test for local label data access from i8086 inline asm
git-svn-id: trunk@32178 -
2015-10-28 17:00:35 +00:00
nickysn
83d90c7888 + extended test with call/jmp [d]word ptr const, which produces an indirect call or jump under BP7
git-svn-id: trunk@32177 -
2015-10-28 15:22:33 +00:00
nickysn
a7a71f8b9f + extended test with many more variants, supported by BP7 for specifying an indirect call/jmp
git-svn-id: trunk@32176 -
2015-10-28 14:57:35 +00:00
nickysn
1fc1739c1d + added calls to local labels in a far procedure to the test as well
git-svn-id: trunk@32175 -
2015-10-28 14:33:32 +00:00
nickysn
85f4b8aa5e + added calls to labels to the tests
git-svn-id: trunk@32174 -
2015-10-28 13:59:35 +00:00
nickysn
fe3711bf6a + added interrupt procedures to the tests
git-svn-id: trunk@32173 -
2015-10-28 13:49:48 +00:00
nickysn
13441261f2 + extended tests with some additional ways to produce call relative near/absolute far in BP7's inline asm
git-svn-id: trunk@32172 -
2015-10-28 13:32:18 +00:00
nickysn
30718a2601 + added i8086 inline asm near relative and far absolute call tests (TP7
compatible, but not yet working under FPC, unfortunately)

git-svn-id: trunk@32164 -
2015-10-27 14:39:02 +00:00
nickysn
6b89ea1af2 + added an i8086 inline assembler test for the near and far ret instructions
git-svn-id: trunk@32158 -
2015-10-26 17:06:17 +00:00
yury
05ecee1895 * tinterlockedmt test: Ensure all threads have started.
git-svn-id: trunk@32156 -
2015-10-26 10:14:47 +00:00
yury
1127689dba * tinterlockedmt test: Reduced the thread count.
git-svn-id: trunk@32148 -
2015-10-25 17:35:36 +00:00
nickysn
1491d9655c + fixed the emitting of non-nil far and huge pointer constptrs in typed
constants on i8086

git-svn-id: trunk@32141 -
2015-10-24 20:25:49 +00:00
yury
4ae1d23909 * tinterlockedmt test: Increased timeout.
git-svn-id: trunk@32111 -
2015-10-21 09:02:16 +00:00
nickysn
520f7226aa + added test for i8086 inline asm far and near indirect jmps as well
git-svn-id: trunk@32110 -
2015-10-21 01:26:15 +00:00
nickysn
2fbcdaf7d5 * fix typo
git-svn-id: trunk@32109 -
2015-10-21 01:22:23 +00:00
nickysn
bdf719c4df * updated comment to inform that 'call far reg' is not a valid x86 instruction
at all, and not just that we don't expect it

git-svn-id: trunk@32108 -
2015-10-21 01:19:23 +00:00
nickysn
c5aa64bc2c + added an i8086 inline asm test for the indirect near and far call instructions
git-svn-id: trunk@32107 -
2015-10-21 01:07:00 +00:00
yury
9bece502a0 * tinterlockedmt test: Reworked test for InterlockedCompareExchange to be more robust.
git-svn-id: trunk@32101 -
2015-10-20 12:43:52 +00:00
yury
325a79b81b * tinterlockedmt test: Another fix to improve threads synchronization. Should fix slow execution on some systems.
git-svn-id: trunk@32095 -
2015-10-19 11:34:52 +00:00
pierre
89f5b65bbf New aarch64-linux gcc compiled objects generated on GCC Compile Farm gcc115 machine
git-svn-id: trunk@32094 -
2015-10-19 10:40:35 +00:00
sergei
72f60de3c4 * Added two test cases from Mantis #28584. The issue itself has been fixed with r31475 and r31582.
git-svn-id: trunk@32092 -
2015-10-18 14:48:36 +00:00
yury
3344188f3e * tinterlockedmt: Minor improvement.
git-svn-id: trunk@32091 -
2015-10-18 12:41:35 +00:00
yury
3fcbb7d2d4 * tinterlockedmt: Fix race conditions in the InterLockedCompareExchange test.
git-svn-id: trunk@32089 -
2015-10-18 11:07:29 +00:00
yury
44777f3797 * Use ThreadSwitch.
git-svn-id: trunk@32076 -
2015-10-17 16:03:18 +00:00
yury
e3d06cdba7 + Stress test for Interlocked* functions using multiple threads.
git-svn-id: trunk@32073 -
2015-10-17 14:48:04 +00:00
yury
a4f63a07d2 * Skip this test for android.
git-svn-id: trunk@32007 -
2015-10-10 21:57:08 +00:00
Jonas Maebe
e25c5b809e * use cextended instead of clongdouble, so that the tests keeps compiling
for platforms where we don't support the "long double" type

git-svn-id: trunk@31883 -
2015-09-29 07:44:07 +00:00
yury
bbb1cae57f * Use "clongdouble" instead of "extended" in libc printf tests.
git-svn-id: trunk@31864 -
2015-09-27 21:14:04 +00:00
Jonas Maebe
84b47dc92c * fixed test on systems not using UTF-8 as defaultsystemcodepage. This test
was correct before the ansistrings with codepage support had been
    implemented, and by accident kept working afterwards on platforms that
    don't use UTF-8 as defaultsystemcodepage, but after r31831 it started
    failing. This commit fixes it again, in combination r31847 (by ensuring
    that the string data passed to ansistart/endtext is encoded in
    defaultsystemcodepage).

git-svn-id: trunk@31848 -
2015-09-27 14:46:44 +00:00
svenbarth
17a0ac7fc0 pdecsub.pas:
* extend parse_proc_head() with support for /parsing/ generic functions (at least in mode Delphi, mode ObjFPC depends on the new isgeneric parameter to be set)
  * adjust parsing of interface mappings with a generic interface (note: in mode ObjFPC this now requires a "specialize" directly before the generic interface's name, which is more in line with other uses of "specialize")
pexpr.pas, factor:
  * don't call postfixoperators() if hadspecialize is set

tests/test/tgeneric79.pp:
  * adjust test to changed syntax

git-svn-id: trunk@31769 -
2015-09-18 16:24:07 +00:00
yury
6e638e31d7 * Use cp1251 on Android.
git-svn-id: trunk@31725 -
2015-09-16 17:49:38 +00:00
yury
d106fc9823 * Use cp1251 on Android.
git-svn-id: trunk@31723 -
2015-09-16 17:35:22 +00:00
michael
a687cc1469 * Add tests for offset argument to pos
git-svn-id: trunk@31465 -
2015-08-31 13:06:14 +00:00
Jonas Maebe
c27807ee63 * resolve formal/anonymous external classes before comparing parameters to
overloaded routines

git-svn-id: trunk@31458 -
2015-08-30 14:33:01 +00:00
Jonas Maebe
945fd4fcf5 * wait till the end of typecheckpass before we load a call context's self
parameter instead of immediately doing it in the constructor of the call
  node, and then only create it if we actually need it.

  It was previously created in the call node constructor because it needs to be
  done before pass_1 (which is where it is actually used) due to pass_1 possibly
  being performed in the context of inlining (and then a wrong self parameter
  may be found, or none at all), and it was done unconditionally because at that
  point we don't know yet whether or not a self parameter will be necessary (as
  we haven't resolved the overloads/procdef yet).

  The problem with this is that if we use the parentfpstruct way of handling
  accesses to outer scope locals/parameters, we need to know all locals/
  parameters that will be accessed from nested routines after typecheckpass,
  otherwise we get crashes. The problem was that if a call to an RTL routine was
  generated by the compiler in a routine nested inside a method during pass_1,
  and this nested routine itself did not access self of the method (so self was
  not added to its parentfpstruct during the typecheckpass), then the
  unconditional reference to self when creating the call caused a compiler
  crash (introduced in r30908)

git-svn-id: trunk@31197 -
2015-07-07 16:34:14 +00:00
Jonas Maebe
8e406cc7bd * fixed bug in test exposed by r31038
git-svn-id: trunk@31044 -
2015-06-13 22:12:45 +00:00
Jonas Maebe
26044b604f * don't import org.freepascal.rtl.* as this also includes our System
class, which conflicts with java.lang.System in recent jdk javac's
    (and we don't access any of the RTL classes explicitly in the
    test program)

git-svn-id: trunk@30952 -
2015-05-31 16:50:53 +00:00
Károly Balogh
99421ba032 tfexpand: fixed some AMIGA vs. HASAMIGA defines, fixed DriveSep definition for Amiga systems
git-svn-id: trunk@30774 -
2015-05-03 11:35:07 +00:00
florian
fbd6d2a0f9 + check for FPUNONE
git-svn-id: trunk@30750 -
2015-05-01 14:46:37 +00:00
Tomas Hajny
3ded26a774 * correction of tests for Amiga (volumes, exclusion of some '.'/'..' related tests)
git-svn-id: trunk@30654 -
2015-04-18 18:48:42 +00:00
michael
46a0eced9e * Adapted test to test for 27831
git-svn-id: trunk@30641 -
2015-04-18 07:16:02 +00:00
Jonas Maebe
faf3efe139 + Linux/ppc64le test object files
git-svn-id: trunk@30228 -
2015-03-14 18:37:01 +00:00
Jonas Maebe
5b3c511467 * don't crash when "return exitvalue" is used in a procedure
git-svn-id: trunk@30177 -
2015-03-13 08:35:26 +00:00
Jonas Maebe
2dcd42d4f1 * fixed detection of an objcprotocols descending from a forward-defined
objcprotocol

git-svn-id: trunk@30169 -
2015-03-12 19:37:43 +00:00
Jonas Maebe
00642288b8 * extended bsf/bsr tests with values in which more than one bit is set
git-svn-id: trunk@30151 -
2015-03-09 16:48:26 +00:00
Jonas Maebe
ff020a3be4 + "Utf8CodePointLen(pansichar,MaxLookAhead,IncludeCombiningDiacriticalMarks):
sizeint"  function that returns:
   <0: invalid sequence detected after processing "-result" bytes
   0:  incomplete (may still be valid if MaxLookAhead is increased)
   >0: sequence of result bytes forms a codepoint (+ combining diacritical
       marks if that parameter was true)

git-svn-id: trunk@30047 -
2015-03-01 17:12:17 +00:00
Tomas Hajny
b2475353f4 * test programs previously having extension .pas renamed to .pp so that they are found during testsuite runs
git-svn-id: trunk@30024 -
2015-02-27 13:03:13 +00:00
Jonas Maebe
b5b7e0f338 * ensure that 64->32 bit truncations cannot be optimized away by the
register allocator on AArch64 + test (did not get caught by existing
    tests)

git-svn-id: trunk@29965 -
2015-02-23 22:55:54 +00:00
Jonas Maebe
c6daaa28d0 * enable all Objective-C tests for Darwin/AArch64
git-svn-id: trunk@29945 -
2015-02-23 22:54:24 +00:00
Jonas Maebe
41fba0c4f7 * switched to using the stack pointer as base register for the temp allocator
instead of the frame pointer register:
      1) we exactly know the offsets of the temps from the stack pointer
         after pass 1 (based on the require parameter stack size for called
         routines), while we don't know it for the frame pointer (it depends
         on the number of saved registers)
      2) temp offsets from the stack pointer are positive while those from
         the frame pointer are negative, and we can directly encode much
         bigger positive offsets in the instructions
   o move the stack pointer register to a virtual register in
     loadparentfpn, because many instructions cannot directly operate
     on/with the stack pointer
   o add the necessary register interference edges for the stack pointer
     register

git-svn-id: trunk@29938 -
2015-02-23 22:54:03 +00:00
Jonas Maebe
62fb05b7c4 + Darwin/AArch64 test object files
git-svn-id: trunk@29924 -
2015-02-23 22:53:11 +00:00
Jonas Maebe
f9647b661f + Darwin/AArch64 test object files
git-svn-id: trunk@29918 -
2015-02-23 22:52:52 +00:00
Jonas Maebe
3f5e95791b * use iosxwstr instead of cwstring on Darwin (for iOS 7+ testing)
git-svn-id: trunk@29829 -
2015-02-23 22:48:15 +00:00
svenbarth
5a344ee263 Rework the way how "specialize" is handled. Instead of initializing the specialization of a full type declaration (including unit name and parent types) it is now considered part of the specialized type itself. This means that for example the following code:
type
  TTestLongInt = specialize SomeOtherUnit.TTest<LongInt>;

will now have to read as

type
  TTestLongInt = SomeOtherUnit.specialize TTest<LongInt>;

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

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

+ added tests
* adjusted test webtbs/tw16090.pp

git-svn-id: trunk@29768 -
2015-02-20 16:23:40 +00:00
Jonas Maebe
071282b286 * add methods of objcprotocols to the list of visible "helper" methods when
loading them from ppu (like was already done when they were initially
    compiler), so they can be called via the "id" type even if no classes are
    in scope that implement them

git-svn-id: trunk@29686 -
2015-02-13 15:43:34 +00:00
Tomas Hajny
cd166e6ff6 * modified according to outcomes of discussion with Jonas
git-svn-id: trunk@29677 -
2015-02-12 23:16:13 +00:00
Tomas Hajny
bd719052fa * test updated according to results of discussion with Jonas to work properly also on platforms not using UTF-8 as their default system codepage (and be safe to ignore characters possibly unsupported with current system codepage)
git-svn-id: trunk@29676 -
2015-02-12 23:02:20 +00:00
Tomas Hajny
08a3c45aa3 * test fixed because the original version was wrong (as confirmed by Jonas)
git-svn-id: trunk@29675 -
2015-02-12 17:48:00 +00:00
Tomas Hajny
da21fe94fa * this test can never work correctly on operating systems not providing Unicode support at filesystem API level unless the current codepage happens to support all the characters used within the test (which is unlikely at least)
git-svn-id: trunk@29674 -
2015-02-12 00:55:18 +00:00
Tomas Hajny
8c20ff7f91 * fix for AllowOneTrailingSeparator and AllowMultipleTrailingSeparators checks and tests using these variables according to the passed parameters
git-svn-id: trunk@29671 -
2015-02-11 21:22:01 +00:00
pierre
82f751d51a Handle one trailing separator separately from multiple
git-svn-id: trunk@29670 -
2015-02-11 10:58:04 +00:00
Tomas Hajny
2cf9d18b14 * invalid DosError display improved
git-svn-id: trunk@29665 -
2015-02-10 16:43:15 +00:00
Tomas Hajny
3caf47d756 * display the wrongly obtained invalid DosError value too
git-svn-id: trunk@29664 -
2015-02-10 16:40:06 +00:00
pierre
488024ea5c Fix for failures on FileNameCaseSensitive systems
git-svn-id: trunk@29609 -
2015-02-02 21:49:36 +00:00
Jonas Maebe
5d4837329b * changed {$modeswitch blocks} to {$modeswitch cblocks} to avoid confusion
with the Pascal meaning of the term "block"

git-svn-id: trunk@29594 -
2015-02-01 15:50:06 +00:00
Tomas Hajny
caa749f6a0 * UTF-8 may not be the system codepage on OS/2 - skipped
git-svn-id: trunk@29566 -
2015-01-27 16:47:40 +00:00
Tomas Hajny
693a239842 * information about GCC version used for compiling the OS/2 object files added
git-svn-id: trunk@29565 -
2015-01-27 16:24:24 +00:00
pierre
84bb209ce8 Add some missing C compiler information found inside C objects
git-svn-id: trunk@29564 -
2015-01-27 13:48:44 +00:00
Tomas Hajny
5a03b52801 * compiled object files for OS/2
git-svn-id: trunk@29563 -
2015-01-27 09:20:55 +00:00
Tomas Hajny
d3ee7d4999 * there is no wchar.h included in EMX GCC port (but it is fortunately not needed for our testsuite)
git-svn-id: trunk@29562 -
2015-01-27 09:17:05 +00:00
pierre
ddee662665 Add i386 specific check that fpu stack is completely empty in CheckStack function
git-svn-id: trunk@29554 -
2015-01-26 13:13:55 +00:00
pierre
9af030ba9e Add missing x86_64-solaris gcc compiled objects
git-svn-id: trunk@29536 -
2015-01-23 14:23:47 +00:00
pierre
16262bb10e Add missing i386-solaris gcc compiled objects
git-svn-id: trunk@29535 -
2015-01-23 14:18:18 +00:00
Tomas Hajny
150ead4546 * skipping wrAbandoned test unsupported on OS/2 similarly to MS Windows
git-svn-id: trunk@29528 -
2015-01-22 23:52:22 +00:00
Tomas Hajny
33856b9f7b * fix typo in message and deallocate all previously allocated memory
git-svn-id: trunk@29527 -
2015-01-22 23:49:04 +00:00
Tomas Hajny
054ada1191 * skip this test for os2 and emx targets because it tries to link in a resource file in MS Windows format (rather than the OS/2 format) which is not supported
git-svn-id: trunk@29523 -
2015-01-22 21:24:21 +00:00
Jonas Maebe
dc172ef55b * disabled blocks tests for Darwin/ppc(64), as the blocks runtime is only
only shipped with Mac OS X 10.6 and later (and the last version supporting
    ppc was 10.5)

git-svn-id: trunk@29522 -
2015-01-22 19:56:34 +00:00
Jonas Maebe
146e3bcb9e * synchronised with trunk till r29513
git-svn-id: branches/blocks@29516 -
2015-01-21 23:28:34 +00:00
Jonas Maebe
8fe981cccb * also give a warning when a field masks an identifier from a category
* also give a warning when a field/parameter/local variable masks an
    identifier from a class helper that's in scope

git-svn-id: trunk@29498 -
2015-01-17 15:38:29 +00:00
Jonas Maebe
990e47f2d3 * give a warning instead of an error if a parameter or local variable in a
an Objective-C method masks an identifier from a category, because due
    to the fact that all standard categories are imported at the same time via
    the CocoaAll unit, this can often happen with categories you don't know/
    care about. These errors also didn't happen in 2.6.x

git-svn-id: trunk@29497 -
2015-01-17 15:27:42 +00:00
svenbarth
a4e8f00399 Allow the usage of type aliases of generic type parameters outside of the generic. Besides being useful by itself it will also be needed in the future when the visibility of the type parameters is changed from public to strict private.
ptype.pas, id_type:
  * don't generate an error if the undefineddef typesym is an explicit rename that belongs to a generic

+ added test

git-svn-id: trunk@29485 -
2015-01-16 16:38:51 +00:00
svenbarth
5848637db3 Fix generation of class names for specializations.
symdef.pas, tstoreddef:
  * is_specialization: fix exit condition to correctly recognize specializations

+ added test

git-svn-id: trunk@29328 -
2014-12-26 18:14:52 +00:00
sergei
ba61a9f95c * Fix bug #26370: A multi-dimensional variant array is "empty" when any of its dimensions has zero range, range of other dimensions does not matter.
git-svn-id: trunk@29324 -
2014-12-25 16:59:52 +00:00
svenbarth
27f398851b The assumptions of test tthlp22 have changed.
tests/test/tthlp22.pp:
  * this test fails no longer as Mode Delphi by default also contains modeswitch TypeHelpers
  * adjust program name for consistency

git-svn-id: trunk@29274 -
2014-12-12 17:20:13 +00:00
svenbarth
7b216d7fa6 Fix for Mantis #27120.
pdecobj.pas, parse_object_members:
  * also allow class fields for helper types

+ added tests

git-svn-id: trunk@29270 -
2014-12-12 13:57:43 +00:00
florian
dd967eb136 * handle records in iso mode properly if no tag-field is given
git-svn-id: trunk@29259 -
2014-12-11 19:21:13 +00:00
Jonas Maebe
cec82a1540 * translate placeholder code page numbers into actual code pages in
fpc_ansistr_to_widechararray(), so that CP_ACP/CP_OEM etc are properly
    handled (fixes assign/assignfile with non-ansi characters in source files
    that don't explicitly specify the code page)

git-svn-id: trunk@29218 -
2014-12-08 12:11:33 +00:00
pierre
437272a037 Add check that close on non-open files generate IOresult=103
git-svn-id: trunk@29201 -
2014-12-04 15:22:45 +00:00
sergei
3f2022cba7 + Commit test for bug #27044.
git-svn-id: trunk@29110 -
2014-11-22 17:36:36 +00:00
florian
7180d184c5 + implements TExtended80Rec, TDoubleRec, TSingleRec
+ test

git-svn-id: trunk@29084 -
2014-11-16 20:47:33 +00:00
Jonas Maebe
3355d0eea0 + jvm setstring test
git-svn-id: trunk@28827 -
2014-10-15 20:50:14 +00:00
Jonas Maebe
5a8c007b73 * added missing errorlevel checks for latest added tests
git-svn-id: trunk@28826 -
2014-10-15 20:50:10 +00:00
Jonas Maebe
d5188ba48a * fixed duplicate field name
git-svn-id: trunk@28819 -
2014-10-14 20:30:08 +00:00
Jonas Maebe
ff583bde6c * made setstring() a compiler intrinsic so it can set the compile-time
code page of ansistrings (mantis #26735)

git-svn-id: trunk@28813 -
2014-10-12 20:27:06 +00:00
nickysn
c279efc9a5 + added normalization and alignment test for HeapOrg and HeapEnd in the
taddint1.pp test

git-svn-id: trunk@28785 -
2014-10-07 14:02:47 +00:00
nickysn
2843194124 + added check for HeapOrg<=FreeList and HeapPtr<=HeapEnd in test ttheap1.pp
git-svn-id: trunk@28784 -
2014-10-07 13:30:34 +00:00
nickysn
445017fab4 + added a TP7 heap compatibility test
git-svn-id: trunk@28656 -
2014-09-14 12:01:09 +00:00
svenbarth
684c8842e7 Fix for Mantis #26599.
pgenutils.pas, check_generic_constraints:
  * correctly handle forward defs if the constraint is either a single IInterface/IUnknown or a TObject/class

+ added tests

git-svn-id: trunk@28601 -
2014-09-05 14:42:22 +00:00
nickysn
d553e4572a + added checks for HeapOrg and HeapEnd to the i8086 compact and large memory
layout tests

git-svn-id: trunk@28469 -
2014-08-19 16:59:54 +00:00
sergei
ff5410b152 + Expanded test also for qword->double and int32->single conversions.
git-svn-id: trunk@28311 -
2014-08-04 21:45:34 +00:00
sergei
586a9aafe8 * The test must have '.pp' extension, of course.
git-svn-id: trunk@28303 -
2014-08-03 00:16:09 +00:00
sergei
8910e2f74d + Added a test checking that conversion of 64-bit integers to double-precision floats depends on current rounding mode when integer has more than 53 bits set.
git-svn-id: trunk@28301 -
2014-08-02 22:42:47 +00:00
Jonas Maebe
2bc8afaa63 + support for calling a method via a block: we capture the method as a
procvar in the local state of the block, and then call it insde the
    generated invoke routine. We can't call it directly there, because
    due to visibility reasons it may not be accessible from a regular
    procedure (e.g. if it is a strict private method)

git-svn-id: branches/blocks@28234 -
2014-07-18 09:15:35 +00:00
Jonas Maebe
c730e16031 * changed the syntax for block procvars from "xxx is block" to
"reference to ...; cdecl;". The "reference to ..." syntax is what Delphi
    uses for anonymous function references. The "cdecl;" indicates that this
    is for the C-variant of such references, which is what blocks are

git-svn-id: branches/blocks@28233 -
2014-07-18 09:15:29 +00:00
Jonas Maebe
bd09b88a5b + support for http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
o blocks are implemented as a variation of procedure variables
   o declaration of a block variable: "test: procedure(c: char) is block;"
     (C equivalent: (void)(^test)(char c) )
   o the compiler automatically converts procedures/functions whose address
     is passed to a block parameter or assigned to a block variable into
     a "block". This consists of
    1) generating a block descriptor (containing the size of the "block
       literal" (see below) and the signature of the invocation function
       encoded as an Objective-C selector)
    2) generating a wrapper function around the original funcion (with C
       calling convention), that has an extra first hidden parameter
       (marked as vo_is_parentfp in the compiler) whose type is a pointer
       to the describing "block literal"
    3) generating the "block literal", which contains a pointer to an
       external variable indicating whether this block captures context or
       not, some flags (see compiler/blockutl.get_block_literal_flags for
       info), a pointer to the wrapper function and a pointer to the
       descriptor. In the future, it will also contain captured variables.
   o right now, only global procedures/functions can be converted to blocks
     (because they don't require state capturing). The next steps are (Object
     Pascal) methods (not Objective-C methods, because Objective-C method
     procvars don't exist) and finally nested functions
   o on Mac OS X, the functionality will only work on Mac OS X 10.7 and later,
     because we have to use the so-called "ABI.2010.3.16" to ensure that
     our blocks aren't called as variadic functions by the runtime (which
     came out after the Mac OS X 10.6 release)
   o while the currently implemented functionality does not require any
     library support at all, there's no use enabling it on other platforms
     because unless it has been confirmed to work with a blocks runtime,
     there's no point in using blocks (they're just somewhat bulky procvars
     right now). Enabling it on other platforms (in combination with the
     GNUStep Objective-C run time), should simply be a matter of adding
     the right {$linklib xxx} statement to rtl/inc/blockrtl.pp file, adding
     that file to Makefile.fpc for that platform and adding that platform
     to the compiler/systems.systems_blocks_supported set

git-svn-id: branches/blocks@28232 -
2014-07-18 09:15:22 +00:00
nickysn
6770301fe7 + added a normalized huge pointer comparison test
git-svn-id: trunk@28215 -
2014-07-13 13:07:01 +00:00
nickysn
ba1ee49b64 + added non-normalized huge pointer comparison test
git-svn-id: trunk@28213 -
2014-07-13 12:39:24 +00:00
nickysn
8604372da3 + implemented far pointer comparison operating only on the offset (+ added test)
git-svn-id: trunk@28179 -
2014-07-06 22:45:19 +00:00
sergei
94796e9e7e * Output divisor in all diagnostic messages, not just some of them.
git-svn-id: trunk@28172 -
2014-07-06 08:26:37 +00:00
nickysn
18246bd9ed + added tests for >, <, >= and <= with equal pointers in the thugeptr2.pp and
thugeptr2a.pp tests

git-svn-id: trunk@28168 -
2014-07-05 15:52:14 +00:00
nickysn
c8c842b857 + added tests for >, <, >= and <= with equal pointers in the tfarptr2.pp test
git-svn-id: trunk@28165 -
2014-07-05 15:15:23 +00:00
nickysn
5097b90e39 + enabled the huge pointer size test in the tptrsize.pp test
git-svn-id: trunk@28164 -
2014-07-05 10:30:55 +00:00
nickysn
6e9720e830 + added tests for huge pointer normalized and non-normalized equality comparison
git-svn-id: trunk@28163 -
2014-07-05 10:19:26 +00:00
nickysn
fda9cfea12 + extended test tfarptr2.pp with far pointers which are different, but point to
the same linear address

git-svn-id: trunk@28162 -
2014-07-05 10:01:45 +00:00
nickysn
5093c573dc + added huge pointer assignment and far->huge conversion tests
git-svn-id: trunk@28091 -
2014-06-27 16:56:02 +00:00
nickysn
82d393014b + added a test for the tiny memory layout
git-svn-id: trunk@28079 -
2014-06-26 17:38:38 +00:00
nickysn
835fb1d157 + added memory layout tests for the small and medium memory models
git-svn-id: trunk@28078 -
2014-06-26 17:30:32 +00:00
nickysn
57de15e071 + added checks for the Program Segment Prefix's relative position to the code
segment in the compact and large memory layout tests

git-svn-id: trunk@28074 -
2014-06-26 09:58:12 +00:00
nickysn
be0afd9625 + added checks for the pointer and procvar sizes in the compact and large memory
layout tests

git-svn-id: trunk@28073 -
2014-06-26 09:20:51 +00:00
nickysn
d00c67f9d3 * limit the heap to 16kb in the i8086 far data memory models for the dos unit
tests that execute a child process. Otherwise, by default, all DOS memory is
  reserved in these memory models, there's no DOS memory left for the child
  process and exec() fails.

git-svn-id: trunk@28061 -
2014-06-25 13:43:44 +00:00
nickysn
a9ddf18779 + call SwapVectors before and after Exec under FPC as well. SwapVectors is
implemented on two FPC platforms (go32v2 and msdos). On the platforms that
  don't need it, it does nothing, so it's safe to call on all platforms.

git-svn-id: trunk@28060 -
2014-06-25 13:35:11 +00:00
nickysn
3952f8830c + added test for the i8086 compact model memory layout
git-svn-id: trunk@28050 -
2014-06-24 19:48:37 +00:00
nickysn
57b233e724 + added test for the memory layout of the i8086 large memory model
git-svn-id: trunk@28040 -
2014-06-23 21:08:51 +00:00
Jonas Maebe
8634aa8ad2 * fixes for the support for overriding properties on the JVM target:
o only create an accessor wrapping the inherited accessor at a
     potentially lower visibility level if the overriding property
     itself does not specify a different accessor to use
   o simplified code
   o tests

git-svn-id: trunk@27954 -
2014-06-14 10:35:35 +00:00
Jonas Maebe
2075dc5a53 * support for raising the visibility of inherited properties on the JVM
target (generate new getters/setters with increased visibility that
    call the inherited ones, if necessary)

git-svn-id: trunk@27940 -
2014-06-12 11:08:44 +00:00
sergei
886159e73a * Renamed testdll2.pp into ttdllex1.pp so it falls into same chunk with ttdllexe.pp and can be located at runtime.
git-svn-id: trunk@27850 -
2014-06-04 12:30:35 +00:00
sergei
128cdd2a65 * Renamed testdll.pp into ttdlltes1.pp so it falls into same chunk with ttdlltest.pp and can be located at runtime.
git-svn-id: trunk@27849 -
2014-06-04 12:10:51 +00:00
sergei
bdb2993277 * Renamed tlib* tests so all file names of dependent tests differ only in last letter. This fixes failures caused by inability to locate dlls at runtime.
git-svn-id: trunk@27848 -
2014-06-04 11:53:07 +00:00
michael
6c7ab322a1 * Applied patch from Laco to fix bug ID #25939
git-svn-id: trunk@27846 -
2014-06-03 11:45:22 +00:00
florian
bb129a6d6c * renamed overloaded fma functions into functions encoding explicitly the type
git-svn-id: trunk@27766 -
2014-05-11 11:51:41 +00:00
Jonas Maebe
2075bf157e * insert JVM checkcast instructions when a voidpointer is implicitly
converted to an incompatible type

git-svn-id: trunk@27744 -
2014-05-10 12:47:34 +00:00
Jonas Maebe
675498a53e * javaa -> java
git-svn-id: trunk@27743 -
2014-05-10 12:47:31 +00:00
Jonas Maebe
20b8ade8ce * added readbarriers as counterparts for the writebarriers (see
"SMP BARRIER PAIRING"
    in https://www.kernel.org/doc/Documentation/memory-barriers.txt ), should
    fix sporadic crashes of the test

git-svn-id: trunk@27726 -
2014-05-03 16:16:17 +00:00
florian
8207e0ef22 + make use of vfnmsub*/vfmsub*/vfnmadd* instructions if possible
git-svn-id: trunk@27721 -
2014-05-02 21:07:46 +00:00
nickysn
8c86d64866 * fixed 'data structure too large' error in test tcall1.pp in the i8086 large
memory model

git-svn-id: trunk@27710 -
2014-05-01 18:27:01 +00:00
nickysn
4bbf2e8618 + enabled {$hugecode} for the test tcalcla1.pp in i8086 large memory model,
because in this model, the code of the test exceeds 64kb

git-svn-id: trunk@27699 -
2014-04-30 21:45:04 +00:00
Jonas Maebe
02ce2e6029 * moved to correct directory
git-svn-id: trunk@27695 -
2014-04-30 19:25:02 +00:00
Jonas Maebe
8ac4a770a9 * check whether file/text is assigned in erase/rename (mantis #25932)
git-svn-id: trunk@27694 -
2014-04-30 18:31:22 +00:00
florian
33602db802 * try to registers more cleverly during fma code generation
git-svn-id: trunk@27671 -
2014-04-26 18:11:13 +00:00
nickysn
c5badc8a7c * fixed test cg/tvec.pp for small CPUs
git-svn-id: trunk@27652 -
2014-04-25 12:12:51 +00:00
nickysn
2de6edc44e * skip the large mem move test (which requires 4MB of memory) in tmem.pp on 16
and 8-bit CPUs

git-svn-id: trunk@27649 -
2014-04-25 09:18:04 +00:00
pierre
d57d816744 powerpc64-aix C objects files added using gcc 4.8.1
git-svn-id: trunk@27585 -
2014-04-16 06:24:07 +00:00
florian
0a312a783e * avoid generation of avx code before the check if avx is supported
git-svn-id: trunk@27582 -
2014-04-14 18:18:29 +00:00
sergei
07e90aaa24 + Implemented IEEE 754-compliant checking for unordered results of floating-point compares on x86 targets. Mantis #9362.
git-svn-id: trunk@27581 -
2014-04-14 12:36:11 +00:00
florian
d88d644925 + support for FMA intrinsic: if there is no hardware support, the compiler throws an error.
Currently it is implemented only for x86-CPUs supporting the FMA extension. While it would
  be possible to implement it in software or simulate fma(<single>,<single>,<single>) using
  double operations, it makes no sense in my opinion to do so.

git-svn-id: trunk@27564 -
2014-04-13 19:21:54 +00:00
Jonas Maebe
4a0528399e * check all overloaded routines for mangled name conflicts on the JVM
platform, as different Pascal declarations are mapped to the same
    JVM representation

git-svn-id: trunk@27520 -
2014-04-10 21:07:14 +00:00
Jonas Maebe
3a5e675a2b * fixed typo in last change (javaa instead of java)
git-svn-id: trunk@27519 -
2014-04-10 21:07:09 +00:00
nickysn
a9cfd647ae + added i8086-msdos tests for interrupt procs, intr, getintvec and setintvec
git-svn-id: trunk@27503 -
2014-04-07 22:26:45 +00:00
nickysn
bf1e15fd39 + added another far pointer arithmetic test
git-svn-id: trunk@27490 -
2014-04-06 15:36:17 +00:00
nickysn
cef4092f3d - rm some unneeded assignments from the test
git-svn-id: trunk@27489 -
2014-04-06 15:27:53 +00:00
nickysn
a11c7fe476 + report the number of the failing test in the exit code
git-svn-id: trunk@27488 -
2014-04-06 15:15:22 +00:00
nickysn
cd90154b9c + added pointer const tests to the far pointer arithmetic test tfarptr3.pp
git-svn-id: trunk@27486 -
2014-04-06 15:11:49 +00:00
nickysn
8d1ed088c8 + implemented far pointer arithmetic (operating only on the offset, without
touching the segment)

git-svn-id: trunk@27485 -
2014-04-06 13:12:29 +00:00
Jonas Maebe
54964d92eb + forgot to commit, part of r26472
git-svn-id: trunk@27382 -
2014-03-30 16:55:03 +00:00
sergei
1744988962 * Modified behavior of CExtended type in overload selection: it is made more compatible to Extended than to Double and Single. Also an Extended parameter selects a CExtended overload (if available) instead of Double.
+ Test.

git-svn-id: trunk@27366 -
2014-03-30 07:31:58 +00:00
florian
775ac591df * fix test: fma support does not necessarily mean that there is avx2 support
git-svn-id: trunk@27294 -
2014-03-27 09:41:59 +00:00
florian
ff6afe27cd * enabled fma instruction as the compiler knows them since r27209
git-svn-id: trunk@27210 -
2014-03-20 20:08:58 +00:00
florian
5d57f38619 + functions for FMA and AVX2 detection
git-svn-id: trunk@27202 -
2014-03-20 15:47:51 +00:00
nickysn
1ef9a0509b - rm packset 1, because that's already the default in delphi mode
git-svn-id: trunk@27160 -
2014-03-16 15:32:35 +00:00
nickysn
015c7e951a * Changed the default packset setting to 1 and disabled the padding of 3-byte
sets to 4 bytes on 16 and 8-bit CPUs. This is compatible with Turbo Pascal 7
  and Delphi 1.

git-svn-id: trunk@27140 -
2014-03-14 23:51:14 +00:00
nickysn
19a39cde4a * 16-bit objpas.integer type fixes in Math.DivMod
git-svn-id: trunk@27052 -
2014-03-09 16:46:49 +00:00
nickysn
5ac193dfc3 * fixed test tbsx1.pp for a 16-bit objpas.integer type
git-svn-id: trunk@27050 -
2014-03-09 16:45:15 +00:00
florian
c9f7c7d88c + test for windows which tests if an .rc file can be really compiled into an .res file
git-svn-id: trunk@27042 -
2014-03-09 10:54:33 +00:00
florian
08a4e1efe1 * handle for ... in on arrays of constant correctly, resolves also #25838
+ tests

git-svn-id: trunk@27039 -
2014-03-09 09:03:22 +00:00
nickysn
30b1aa1d96 * document the known delphi xe3 64-bit test failures
git-svn-id: trunk@26903 -
2014-02-28 14:08:50 +00:00
Jonas Maebe
9315c121d4 - removed cwstring again, it's not needed and breaks compilation of the test
on non-Unix platforms

git-svn-id: trunk@26896 -
2014-02-27 11:54:48 +00:00
michael
7593696a03 * Fixed all tests to be D2009+ compatible
git-svn-id: trunk@26894 -
2014-02-27 09:07:56 +00:00
nickysn
888ecdaee4 * fixed the type conversions of the 'and' operator to be Delphi compatible. Fixes Mantis #25179
git-svn-id: trunk@26882 -
2014-02-25 18:06:29 +00:00
michael
9faea4e757 * Fixed test so the same result as in Delphi
git-svn-id: trunk@26877 -
2014-02-25 10:35:39 +00:00
michael
ff2b6a90d9 * Added tests for various strutils functions by Karl-Michael Schindler (bug ID 25756)
git-svn-id: trunk@26833 -
2014-02-22 12:40:31 +00:00
svenbarth
ddb78fefdc Add a modeswitch for type helpers as discussed in core on 24th October 2013. It is disabled by default in all modes (afterall type helper support in Delphi started only beginning with XE3)
+ globtype.pas: add new modeswitch to modeswitch enum and name array
* ptype.pas & pdecobj.pas: check for new modeswitch instead of modeswitch class
* ppu.pas: increase ppu version as we've added a new modeswitch which requires correctly compiled units

* adjusted tests to enabled the modeswitch when necessary
+ added three new tests that check for correct functionality of modeswitch typehelpers

git-svn-id: trunk@26796 -
2014-02-16 12:58:24 +00:00
florian
711c533573 * moved test because it tests a certain functionalty and was made solely to test strutils.IsWild
git-svn-id: trunk@26788 -
2014-02-15 15:32:50 +00:00
florian
5dcb59c2d4 * renamed test, resolves #25696
git-svn-id: trunk@26733 -
2014-02-08 19:21:08 +00:00
yury
78304dde66 * mipsel-android: Added C object files for tests.
git-svn-id: trunk@26710 -
2014-02-07 14:40:25 +00:00
sergei
a1dfaa54dd * Fixed exception handling in constructors of TP-style objects to correctly handle cases of statically allocated objects (must call destructor but do not free memory) and objects without destructor (must free memory if it was allocated dynamically).
+ Test extended.

git-svn-id: trunk@26676 -
2014-02-05 18:19:13 +00:00
sergei
a5d5ce8eb2 * TP-style object destructors do not need actual VMT in hidden parameter, a constant flag indicating need to free memory is sufficient.
* Destructor called from exception block in constructor must have this flag set in order to free memory.
+ Test.

git-svn-id: trunk@26656 -
2014-02-03 00:20:42 +00:00
florian
be17962748 * delete test file immediately after they were used, external tools might get into trouble trying deleting them due to the uncommon names
git-svn-id: trunk@26655 -
2014-02-02 19:10:42 +00:00
florian
ecdfe75841 * tests fail if dead values are optimized so disable dead value optimization for the tests
git-svn-id: trunk@26631 -
2014-01-30 19:44:12 +00:00
nickysn
1faf138667 + fixed mistyped call to BsfWord in test tbsx1.pp
git-svn-id: trunk@26594 -
2014-01-26 23:50:30 +00:00
florian
0e67ca6419 * fixed output of test if a failure happens
git-svn-id: trunk@26505 -
2014-01-18 12:08:02 +00:00
Jonas Maebe
a5653916e0 * convert array indices always to s32int, because that is the index type used
by java arrays (otherwise we may get unwanted sign extensions after
    performing e.g. an s16bit operation, see the test)

git-svn-id: trunk@26472 -
2014-01-15 20:36:52 +00:00
florian
b90db73fbc * fixed test
git-svn-id: trunk@26440 -
2014-01-12 20:17:59 +00:00
Jonas Maebe
d2b8275b99 + support for arbitrary encodings in readstr/writestr
o set the code page of the temporary "text" file to utf-8 for writestr with
     unicodestring/widestring as destination, so that no data loss can occur
     (+ properly deal with cases whereby part of an utf-8 character is
      written to the textbuf in this case)
   o explicitly pass the code page of the destination ansistring for writestr
     with ansistring as destination and set it for the temporary "text" file
   o set the code page of the text file for readstr

git-svn-id: trunk@26317 -
2013-12-29 19:18:49 +00:00
florian
27f6fd1c2c * use new shl/shr constant folding (of r26295) only if forinline is set
* explicitly simplify tree after constant propagation

git-svn-id: trunk@26311 -
2013-12-29 14:09:03 +00:00
florian
739166f3e7 * fix test
git-svn-id: trunk@26308 -
2013-12-29 10:03:41 +00:00
florian
b47f1c4176 * disable constant propagation for tests which will cause a regression because const. prop. causes a compile time error while the tests expect a runtime error
git-svn-id: trunk@26300 -
2013-12-28 20:19:49 +00:00
florian
be807d6cef + tests for dead store removal
git-svn-id: trunk@26299 -
2013-12-28 20:19:46 +00:00
sergei
c3c682fe3f * Changed test so it provides different exit codes depending on the failed assertion.
git-svn-id: trunk@26280 -
2013-12-25 10:33:16 +00:00
florian
99eadb91b3 * run CheckAndWarn to get proper locations for warnings about uninitialized variables
* several fixes to liveness analysis
* get rid of old version defines
+ tests

git-svn-id: trunk@26159 -
2013-12-01 17:01:51 +00:00
florian
92508a9801 * take of life of tlabelnode.left, the test does not test this however because I'am not aware of any example to force a left node for a label
git-svn-id: trunk@26082 -
2013-11-13 19:26:37 +00:00
Jonas Maebe
3e393b867b * small extension of the test
git-svn-id: trunk@26066 -
2013-11-12 10:30:28 +00:00
florian
1d4a4d0684 + noreturn directive
git-svn-id: trunk@26003 -
2013-11-10 09:00:59 +00:00
florian
5f167091c0 * fix test so it works with const. propagation and does throws the range check error at run time
git-svn-id: trunk@25960 -
2013-11-06 21:10:20 +00:00
Jonas Maebe
d4b6406e62 * fixed compilation of new str<->float code on the JVM target (patch by
Max Nazhalov) and use that code by default on the JVM target
  * adapted JVM tests for the new str<->float code similar to how the
    generic tests were adapted

git-svn-id: trunk@25954 -
2013-11-06 16:13:50 +00:00
Jonas Maebe
85059f79fe * readded halt(1) temporarily removed for testing and accidentally committed
git-svn-id: trunk@25890 -
2013-10-31 13:47:49 +00:00
Jonas Maebe
21eeec9981 + re-implementation of real->string and string->real conversion routines
based on the Grisu1 algorithm. This corrects several precision issues
    with the previous code used to perform such conversions (patch by
    Max Nazhalov, mantis #25241)
   o adaptation of several tests to deal with the better precision of these
     routines compared to the previous version
  Please don't remove the real2str.inc file yet, it's still used by the
  JVM target for now

git-svn-id: trunk@25888 -
2013-10-31 12:39:27 +00:00
Jonas Maebe
b70e64dc67 * fixed some bugs in the camelCase conversion performed on the JVM target by
-CTlowercaseprocstart
   o convert all consecutive uppercase characters at the start to lowercase
     instead of only the first one. Exception: if there is more than one
     such character and the last one is followed by a lowercase character,
     assume the last uppercase character belongs to the second word (like
     in FPCIsGreat) and don't lowercase that one
 + test

git-svn-id: trunk@25845 -
2013-10-23 22:44:45 +00:00
nickysn
703e3f3ce2 * fixed test/cg/tcall1.pp for i8086
git-svn-id: trunk@25837 -
2013-10-20 20:09:27 +00:00
nickysn
1f30cd9505 * fixed test tmaclocalprocparam4c.pp for i8086 medium memory model
git-svn-id: trunk@25833 -
2013-10-19 22:42:35 +00:00
nickysn
aab978fd19 * fixed test tmacprocvar for i8086 far code memory models
git-svn-id: trunk@25823 -
2013-10-18 17:23:25 +00:00
nickysn
2a11883ad6 * fixed test units/system/tassignd.pp for i8086 medium/compact memory model
git-svn-id: trunk@25820 -
2013-10-18 14:18:36 +00:00
nickysn
f006476ff0 * fixed tests tprocvar1 and tprocvar3 for i8086 medium/compact memory model
git-svn-id: trunk@25819 -
2013-10-18 14:08:11 +00:00
nickysn
1795368cff * fixed test tchlp24 for i8086 medium/compact memory models
git-svn-id: trunk@25818 -
2013-10-18 13:28:10 +00:00
nickysn
e0350d6f44 + added test tlea2.pp, which tests the LEA instruction with a 64-bit, 32-bit and
16-bit operand size on x86_64

git-svn-id: trunk@25810 -
2013-10-17 18:25:17 +00:00
nickysn
4aa010eedc + support LEA with 16-bit operand size
git-svn-id: trunk@25808 -
2013-10-17 16:11:08 +00:00
nickysn
60537a94ea * fixed test tintuint for i8086 medium memory model
git-svn-id: trunk@25797 -
2013-10-15 22:49:40 +00:00
Jonas Maebe
10ae87f11c * fixed LdrLdr2LdrMov optimisation in case the first and second ldr have
a different size (disable it in that case) + test

git-svn-id: trunk@25778 -
2013-10-14 12:49:34 +00:00
Jonas Maebe
31a3122b91 * fixed LsrAnd2Lsr test by replacing the existing buggy check with comparing
the outcome of the original and the optimised sequence and seeing whether
    it's same + test

git-svn-id: trunk@25776 -
2013-10-14 12:49:28 +00:00
paul
1c578de28c compiler:
* don't allow to apply the same hint directive twice
  * change parser_e_proc_dir_not_allowed to more generic variant parser_e_dir_not_allowed - they are similar and 'procedure' prefix does not give more information about the error.
  * maybe_parse_hint_directives() uses procdef settings for initial values
  + add tests

git-svn-id: trunk@25720 -
2013-10-08 04:56:42 +00:00
florian
6391fd39aa * optimize also tail calls, if it is a simple procedure
git-svn-id: trunk@25688 -
2013-10-06 13:51:38 +00:00
nickysn
07bbfc7c60 + added { on} to test tfarcal1.pp
git-svn-id: trunk@25552 -
2013-09-24 18:15:43 +00:00
svenbarth
9d48bc0baf Implement cross unit type overloading of generics. This fixes the regression introduced with revision 25498.
symtable.pas:
  + add new tsymbol_search_flag type which can be passed to various searchsym* routines
  + add support to not call "addsymref"
  + add new searchsym_with_flags function that calls searchsym_maybe_with_symoption
  * adjust searchsym_maybe_with_symoption, searchsym_in_class & searchsym_in_helper to use new flag type instead of Boolean arguments
  * adjust searchsym & searchsym_with_symoption which call the modified functions
nutils.pas, handle_staticfield_access:
  * adjust searchsym_in_class call
pexpr.pas, handle_factor_typenode, postfixoperators, factor:
  * adjust searchsym_in_helper and searchsym_in_class calls
pinline.pas, new_function:
  * adjust searchsym_in_class call
scanner.pas, try_consume_nestedsym:
  * adjust searchsym_in_class call
fmodule.pas, tmodule:
  + add genericdummysyms field which is a TFPHashObjectList that contains TFPObjectList instances per generic dummy that in turn contains tgenericdummysyms instances
pgenutil.pas:
  + add function split_generic_name to split a generic name into non-generic name and count value of type parameters
  + add function resolve_generic_dummysym which tries to use the new genericdummysyms field to find the real symbol of a dummy sym
  * generate_specialization: adjust searchsym_in_class call
  * specialization_init/specialization_done: save/restore genericdummysyms of module
symdef.pas, tdefawaresymtablestack:
  + add new intermediate method pushcommon which is used by both push and pushafter
  + add new intermediate method remove_helpers_and_generics (which calls remove_generics and remove_helpers if necessary)
  * rename removehelpers to remove_helpers
  * rename addhelpers to add_helpers_and_generics and extend it to correctly fill current_module.genericdummysyms
  * call remove_helpers_and_generics from pop instead of remove_helpers
ptype.pas, single_type, read_named_type.expr_type, read_named_type:
  * try to resolve symbols with sp_generic_dummy with resolve_generic_dummysym

+ added test

git-svn-id: trunk@25519 -
2013-09-18 14:28:46 +00:00
svenbarth
fbceb574eb Fix for Mantis #25041 . Correctly set CurrentThreadVar for those tthread.inc incarnations that don't use the default ThreadProc in classes.inc (this should be changed in the future though...). In addition to Unix systems as described by the bug report this also involved BeOS and Netware LibC.
+ added test

git-svn-id: trunk@25511 -
2013-09-17 18:02:12 +00:00
nickysn
4d369654e0 * fixed test cg/taddr2.pp for i8086 medium memory model
git-svn-id: trunk@25504 -
2013-09-17 01:06:06 +00:00
svenbarth
08543ddeba Fix for Mantis #23899 . Allow to overwrite TStringList.ExchangeItems if necessary.
rtl/objpas/classes/classesh.inc, TStringList:
  * rename the private ExchangeItems to ExchangeItemsInt and allow inlining
  + add a protected virtual ExchangeItems
rtl/objpas/classes/stringl.inc, TStringList:
  * Exchange: call ExchangeItemsInt
  + let default implementation of ExchangeItems simply call ExchangeItemsInt
  * QuickSort: call ExchangeItemsInt directly if there is no override otherwise call ExchangeItems

+ added test

git-svn-id: trunk@25480 -
2013-09-13 14:17:01 +00:00
nickysn
5a42a8d707 + added an i8086 test tfarcal1.pp, which tests calling a far procedure from within inline asm code
git-svn-id: trunk@25435 -
2013-09-08 13:43:52 +00:00
Jonas Maebe
cde2d1b8ee o merged cpstrrtl branch (includes unicode branch). In general, this adds
support for arbitrarily encoded ansistrings to many routines related to
    file system access (and some others).
    
  WARNING: while the parameters of many routines have been changed from
    "ansistring" to "rawbytestring" to avoid data loss due to conversions,
    this is not a panacea. If you pass a string concatenation to such a
    parameter and not all strings in this concatenation have the same
    code page, all strings and the result will be converted to
    DefaultSystemCodePage (= ansi code page by default). In particular,
    concatenating e.g. an Utf8String with a constant string and passing
    the result to a RawByteString parameter will convert the result into
    the DefaultSystemCodePage (unless the source code is compiler with
    {$modeswitch systemcodepage} or {$mode delphiunicode} *and* the ansi
    code page on the system you are compiling *on* happens to be UTF-8)
    
    You can define and use alternative routines that explicitly accept
    Utf8String parameters to avoid this pitfall. Internally, all of these
    routines ensure that they never trigger this condition and ensure that
    not unnecessary/unwanted code page conversions occur.

  + DefaultFileSystemCodePage variable that holds the code page used for
    communicating with the OS single byte file system APIs, and for the
    strings returned by those same APIs. Initialized with
   o the result of GetACP in the system unit of Windows platforms, except for
     WinCE which uses UTF-8 since its file system OS API calls already use
     the UTF-16 versions
   o CP_UTF8 on Unix platforms with FPCRTL_FILESYSTEM_UTF8 defined, and with
     DefaultSystemCodePage on other Unix platforms
   o DefaultSystemCodePage on Java/Android JVM targets
  + DefaultRTLFileSystemCodePage variable that holds the code page used to
    encode strings returned by RTL routines that return filenames obtained
    from OS API calls. By default the same as DefaultFileSystemCodePage on
    all platforms. Separate from DefaultFileSystemCodePage for clarity on
    platforms that may use either utf-16 or single byte OS API calls to
    send/receive file names (such as most Windows platforms)
  + new scpFileSystemSingleByte enum that can be passed to
    GetStandardCodePage() to get the default code page for OS single byte file
    system APIs, with implementations for Unix and Windows
  + SetMultiByteFileSystemCodePage() procedure to override the value of
    DefaultFileSystemCodePage
  + ToSingleByteFileSystemEncodedFileName() function to convert a string to to
    DefaultFileSystemCodePage (does *not* take care of OS-specific quirks like
    Darwin always returning file names in decomposed UTF-8)
  + support for CP_OEMCP
  * textrec/filerec now store the filename by default using widechar. It is
    possible to switch back to ansichars using the FPC_ANSI_TEXTFILEREC define.
    In that case, from now on the filename will always be stored in
    DefaultFileSystemEncoding
  * fixed potential buffer overflows and non-null-terminated file names in
    textrec/filerec

  * when concatenating ansistrings, do not map CP_NONE (rawbytestring) to
    CP_ACP (defaultsystemcodepage), because if all input strings have the
    same code page then the result should also have that code page if it's
    assigned to a rawbytestring rather than getting defaultsystemcodepage
  * do not consider empty strings to determine the code page of the result
    in fpc_AnsiStr_Concat_multi(), because that will cause a different
    result than when using a sequence of fpc_AnsiStr_Concat() calls (it
    ignores empty strings to determine the result code page) and it's also
    slower

  * do not consider the run time code page of the destination string in
    fpc_AnsiStr_Concat(_multi)() because Delphi does not do so either. This
    was introduced in r19118, probably to hide another bug + test
  * never change the code page of a non-empty string when calling setlength on
    it

  * handle the fact that GetEnvironmentStringsA returns the environment in the
    OEM instead of in the Ansi code page (mantis #22524, #15233)
  * don't truncate environment variable strings in GetEnvironmentString(),
    its result is now ansistring/unicodestring depending on whether the
    RTL was compiled with FPC_RTL_UNICODE

  * unix:
   o made the ansistring parameters of the fp*() file system routine overloads
     constant, changed them to rawbytestring and added
     DefaultFileSystemCodePage conversions
   o unicodestring support for POpen(), and DefaultFileSystemCodePage support
     for POpen(RawByteString)

  + DefaultFileSystemCodePage support for dynlibs unit

  + rawbytestring/unicodestring overloads for:
   o system: fexpand, lowercase, uppercase, getdir, mkdir, chdir, rmdir,
     assign, erase, rename
   o objpas: AssignFile, 
   o sysutils: FileCreate, FileOpen, FileExists, DirectoryExists, FileSetDate,
     FileGetAttr, FileSetAttr, DeleteFile, RenameFile, FileSearch, ExeSearch,
     FindFirst, FindNext, FindClose, FileIsReadOnly, GetCurrentDir,
     SetCurrentDir, ChangeFileExt, ExtractFilePath, ExtractFileDrive,
     ExtractFileName, ExtractFileExt, ExtractFileDir, ExtractShortPathName,
     ExpandFileName, ExpandFileNameCase, ExpandUNCFileName,
     ExtractRelativepath, IncludeTrailingPathDelimiter,
     IncludeTrailingBackslash, ExcludeTrailingBackslash,
     ExcludeTrailingPathDelimiter, IncludeLeadingPathDelimiter,
     ExcludeLeadingPathDelimiter, IsPathDelimiter, DoDirSeparators,
     SetDirSeparators, GetDirs, ConcatPaths, GetEnvironmentVariable

    -- the default string type used by FindFirst/Next depends on whether the
      RTL was compiled with FPC_RTL_UNICODE. To force the RawByteString
      version pass a TRawByteSearchRec, for the UnicodeString version pass
      a TUnicodeSearchRec.

  + paramstr(longint):unicodestring available for {$modeswitch unicodestrings}

  + pwidechar versions in sysutils of strecopy, strend, strcat, strcomp,
    strlcomp, stricomp, strlcat, strrscan,strlower, strupper, strlicomp,
    strpos, WideStrAlloc, StrBufSize, StrDispose + tests
    

git-svn-id: trunk@25432 -
2013-09-06 11:04:32 +00:00
Jonas Maebe
de56f909d5 * synchronized with trunk up to and including r25430
git-svn-id: branches/cpstrrtl@25431 -
2013-09-06 10:09:26 +00:00
Jonas Maebe
f539e9158a * small change to r24997: also use the {$modeswitch unicodestrings} state to
determine whether (wide)char->pchar will be preferred over (wide)char ->
    p(wide)char or not (always convert to pchar if mode switch is not active,
    otherwise always to pwidechar). Delphi-compatible + consistent with the
    behaviour added for constant strings in that revision + tests

git-svn-id: branches/cpstrrtl@25430 -
2013-09-06 08:02:59 +00:00
Jonas Maebe
fcaad5baf2 * perform -CTlowercaseprocstart conversion it tprocsym.create rather than
when building the mangled name, because the latter can also be performed
    when compiler another unit (and therefore if that other unit's setting
    is different from that of the original unit, a wrong mangled name was
    generated) + test for this case

git-svn-id: trunk@25388 -
2013-08-29 22:43:06 +00:00
Jonas Maebe
a14ceba791 + -CTinitlocals switch for the JVM that initialises all local variables
that may trigger JVM bytecode verification errors if they are used
    before they are initialised (this includes passing them as a "var"
    parameter) + test
  * sorted -CT parameters alphabetically and alligned them

git-svn-id: trunk@25387 -
2013-08-29 22:21:23 +00:00
Jonas Maebe
6013606a97 + -CTlowercaseprocstart switch to lowercase the first character of routines
so that code written according to Delphi coding standards can be compiled
    into JVM bytecode with routine names conforming to JVM coding standards

git-svn-id: trunk@25385 -
2013-08-29 22:21:15 +00:00
masta
ff95d42216 Fix ShiftShift2Shift 1 ARM-peephole optimizer
The previous code deleted the newly inserted instruction instead of the
existing one, which obviously broke code.

Assembly:
  mov r0, r0, lsr #23
  mov r0, r0, lsr #23

transformed into:
  mov r0, r0, lsr #23

expected was:
  mov r0, #0

The problem only shows up in the very unlikely case of two LSR/ASR or
two LSL following on each other and having a total shift of more than 31
bits.

This fixes test/opt/tarmshift.pp

I've also removed the {%norun} directive from tarmshift.pp as this test
does only make sense when it also runs.

git-svn-id: trunk@25374 -
2013-08-26 17:41:54 +00:00
Jonas Maebe
d5c86bcfef * created combined (lipo'd) armv6 and armv7 versions
git-svn-id: trunk@25322 -
2013-08-21 22:28:17 +00:00
paul
4c23d2281a rtl: fpwidestring:
- retry to load currentMap if it is not assigned
  - add more tests for fpwidestring manager

git-svn-id: trunk@25317 -
2013-08-21 06:56:26 +00:00
paul
2cb8125bfc tests: fix test to use fpwidestring manager (by Inoussa, mantis #0024890)
git-svn-id: trunk@25316 -
2013-08-21 06:35:25 +00:00
paul
ec7be0d231 test: add more fpwidestring tests by Inoussa
git-svn-id: trunk@25311 -
2013-08-20 02:52:07 +00:00
Jonas Maebe
af3f12f60c * rawbytestring/unicodestring versions of findfirst/findnext/findclose
o these routines are now generic wrappers in filutil.inc, and call
     the platform-dependent internalfindfirst/next/close routines
   o on unix, the fnmatch routine got proper support for UTF-8 matching
     (e.g., it won't match a partial UTF-8 code point to a "?" wildcard)
   o for NativeNT, a similar (untested) UTF-16 version has been added
  + test for the above
  * rawbytestring/unicodestring versions of fileage

git-svn-id: branches/cpstrrtl@25302 -
2013-08-19 22:04:25 +00:00
Jonas Maebe
26b7f5a36c * ensure that fexpand(ansistring) never converts its argument to a code page
other than DefaultFileSystemCodePage, so that it can work with strings
    holding any encoding
  + test for fexpand(ansistring) with UTF-8 strings while DefaultSystemCodePage
    is set to CP_ASCII

git-svn-id: branches/cpstrrtl@25300 -
2013-08-19 22:04:15 +00:00
Jonas Maebe
b115231ea4 * never change the code page of a non-empty string when calling setlength on
it

git-svn-id: branches/cpstrrtl@25298 -
2013-08-19 22:04:07 +00:00
paul
7ac3647ff2 rtl: apply patch of Inoussa with Incremental Implementation of the Unicode Collation Algorithm (mantis #0024873)
git-svn-id: trunk@25296 -
2013-08-19 16:35:12 +00:00
Jonas Maebe
8d1090269e * synchronised with trunk r25259
git-svn-id: branches/cpstrrtl@25267 -
2013-08-16 11:33:44 +00:00
Jonas Maebe
1ce93f7430 * when automatically generating an overriding getter/setter method (because
a property in a child class has a higher visibility than the getter/
    setter), ensure that we call the inherited method and not the method
    itself (causing a stack overflow due to infinite recursion)

git-svn-id: trunk@25223 -
2013-08-06 21:50:56 +00:00
Jonas Maebe
fb8fb29574 * record/use the code page of string constants typecasted to an ansistring
type with a non-default code page
   TODO: ensure that string constants typecasted to ansistring become
     ansistrings rather than typeless string constants

git-svn-id: trunk@25207 -
2013-08-02 13:23:32 +00:00
svenbarth
53ea24a0b1 Correctly specialize generics if locally declared types are used (e.g. two procedures could both define a different "TRec" type which is used to specialize a generic inside the procedures).
symtype.pas, tdef:
  + add method "fullownerhierarchyname" which allows to retrieve the owner hierarchy name including procedure/function/method names
  + add method "fulltypename" which uses "fullownerhierarchyname" to return a full type name
symdef.pas, tstoreddef:
  * implement "fullownerhierarchyname" (including caching of the result)
pgenutil.pas, parse_generic_specialization_types_internal:
  * use "tdef.fulltypename" instead of "tdef.typename" to have unique values for each parsed type and thus for the specialization itself

+ tests

git-svn-id: trunk@25175 -
2013-07-26 09:02:24 +00:00
Jonas Maebe
29132f45b7 * synchronised with trunk up to r25167 (fixes glib compilation via r25164,
and occasional crashes in executeprocess on libc platforms via r25167)

git-svn-id: branches/cpstrrtl@25169 -
2013-07-24 14:24:49 +00:00
Jonas Maebe
1a560e9875 * when concatenating ansistrings, do not map CP_NONE (rawbytestring) to
CP_ACP (defaultsystemcodepage), because if all input strings have the
    same code page then the result should also have that code page if it's
    assigned to a rawbytestring rather than getting defaultsystemcodepage
  * do not consider empty strings to determine the code page of the result
    in fpc_AnsiStr_Concat_multi(), because that will cause a different
    result than when using a sequence of fpc_AnsiStr_Concat() calls (it
    ignores empty strings to determine the result code page) and it's also
    slower
  * do not consider the run time code page of the destination string in
    fpc_AnsiStr_Concat(_multi)() because Delphi does not do so either. This
    was introduced in r19118, probably to hide another bug
  + test

git-svn-id: branches/cpstrrtl@25143 -
2013-07-19 16:33:14 +00:00
Jonas Maebe
9b9252e507 * don't depend on the (non-Delphi-compatible) behaviour that the current
code page of a rawbytestring influences the code page of concatenated
    strings assigned to it (this behaviour will be fixed/changed in the
    next commit)

git-svn-id: branches/cpstrrtl@25142 -
2013-07-19 16:32:49 +00:00
Jonas Maebe
957854c0ae + test for assign/rename/erase/mkdir/rmdir with utf8/cp866 encoded file
names

git-svn-id: branches/cpstrrtl@25140 -
2013-07-19 16:32:07 +00:00
nickysn
59d014dd10 + extended test tfarptr2 to also test comparisons with nil
git-svn-id: trunk@25112 -
2013-07-16 13:44:23 +00:00
nickysn
0d565aeba9 + extended test tfarptr2.pp
git-svn-id: trunk@25109 -
2013-07-15 22:36:12 +00:00
nickysn
56fbf8d4fe + added test tfarptr2.pp, which tests far pointer equality comparison
git-svn-id: trunk@25108 -
2013-07-15 22:13:17 +00:00
nickysn
1eaa23b738 + added a simple test for i8086 far pointers
git-svn-id: trunk@25107 -
2013-07-15 14:47:02 +00:00
nickysn
31815fc228 + added a basic i8086 far pointer size test: tptrsize.pp
git-svn-id: trunk@25097 -
2013-07-14 11:54:01 +00:00
Jonas Maebe
0ef0206417 * fixed off-by-one error in the optimised rawbytestring/unicodestring
dodirseparators() routines + added test (only testable under Windows)

git-svn-id: branches/cpstrrtl@25089 -
2013-07-12 17:18:16 +00:00
Jonas Maebe
d66d15aad3 + added mkdir/chdir/rmdir(rawbytestring) and (unicodestring) to the system unit
* renamed platform-specific pchar versions of those rouines to do_*() and
    changed them to either rawbytestring or unicodestring depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API setting
  * implemented generic shortstring versions of those routines on top of either
    rawbytestring or unicodestring depending on the API-kind (in case of the
    embedded target, if ansistring are not supported they will map directly
    to shortstring routines instead)
  * all platform-specific *dir() routines with rawbytestring parameters now
    receive their parameters in DefaultFileSystemCodePage
  - removed no longer required ansistring variants from the objpas unit
  - removed no longer required FPC_SYS_MKDIR etc aliases
  * factored out empty string and inoutres<>0 checks from platform-specific
    *dir() routines to generic ones
  o platform-specific notes:
   o amiga/morphos: check new pathconv(rawbytestring) function
   o macos TODO: convert PathArgToFSSpec (and the routines it calls) to
     rawbytestring
   o nativent: added SysUnicodeStringToNtStr() function
   o wii: convert dirio callbacks to use rawbytestring to avoid conversion
  + test for unicode mk/ch/rm/getdir()

git-svn-id: branches/cpstrrtl@25048 -
2013-07-04 22:28:37 +00:00
Jonas Maebe
5ed4e99dc1 + uppercase/lowercase(unicodestring) (fixes a warning in fina.inc when
compiled with unicodestring)
  * changed uppercase/lowercase(ansistring) to use the same logic as the
    new unicode versions (unify code for lower/upper, only make result
    unique if necessary)
  + test for all four routines

git-svn-id: branches/cpstrrtl@25006 -
2013-06-28 12:46:25 +00:00
Jonas Maebe
746546ed09 + remaining missing pwidechar overloads/equivalents of pchar functions
(strecopy, strend, strcat, strcomp, strlcomp, stricomp, strlcat, strrscan,
     strlower, strupper, strlicomp, strpos, WideStrAlloc, StrBufSize,
     StrDispose)
  * adjusted pwidechar version of strnew to call WideStrAlloc instead of
    StrAlloc
  + tests for several newly added sysutils pwidechar routines based on
    existing tests for equivalent pchar routines
  * converted several sysutils ansistr*() function tests to tests for str*
    functions

git-svn-id: branches/cpstrrtl@24998 -
2013-06-27 21:38:06 +00:00
florian
f50e25afa0 * tests built/updated using gcc 4.8.1
git-svn-id: trunk@24974 -
2013-06-25 18:58:06 +00:00
florian
e44d33f4db * rebuild with gcc 4.7.2, tcalext6 still fails because struct struct1 (one single value) is still returned on the fpu stack by gcc, this is not abi compliant on windows
git-svn-id: trunk@24966 -
2013-06-24 20:53:52 +00:00
pierre
91821acfc6 Use new conditional CPUSMALL and define it for m68k and 8086 cpu to use small array size
git-svn-id: trunk@24964 -
2013-06-24 15:40:08 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
o resolved conflict in updated morphos sysutils unit
   o moved code that had been added to the now deleted  sysunix.inc to the
     unix-specific block of the fpwidestring unit's init code

git-svn-id: branches/cpstrrtl@24913 -
2013-06-17 20:50:02 +00:00
florian
37df6f6455 * nostackframe now results in an error if used on pascal subroutines
git-svn-id: trunk@24910 -
2013-06-16 18:59:03 +00:00
pierre
55252e82f2 Remove readln and add mode delphi
git-svn-id: trunk@24807 -
2013-06-05 15:42:46 +00:00
svenbarth
6ad761912f Add a Delphi compatible test for passing of different string like types to UnicodeString/RawByteString parameters.
git-svn-id: trunk@24648 -
2013-05-30 16:54:17 +00:00
sergei
23cb216435 * RTTI fix for alignment-sensitive targets:
* typinfo.pp: the newly introduced records were added into {$PACKRECORDS 1} area of effect, which  effectively made all records packed, entirely defeating FPC_REQUIRES_PROPER_ALIGNMENT purpose. 
  * added alignment between TProcedureParam records, adjusted TProcedureSignature.GetParam() appropriately.
   * ncgrtti.pas: added two missing alignments and removed a redundant one.
   * tests/test/trtti9.pp: modified to use TProcedureSignature.GetParam() and endian-independent check for parameter flags.

git-svn-id: trunk@24562 -
2013-05-23 16:03:42 +00:00
pierre
cc8708c3c9 Improve test to allow easier understanding of errors
git-svn-id: trunk@24516 -
2013-05-16 22:05:10 +00:00
paul
bc973e538d compiler: write extended RTTI for tkProcVar (tkProcedure in Delphi)
rtl: add appropriate types for tkProcVar RTTI (based on Delphi help)
+ test

git-svn-id: trunk@24468 -
2013-05-08 02:52:13 +00:00
paul
dce960c97b compiler: write Delphi compatible tkArray RTTI:
- TotalSize of all array dimensions instead of first dimension size
  - Element type of last array dimension
  - dimension information
rtl:
  - adopt array initialization/finalization/copy for the new tkArray RTTI
  - add Delphi compatible TArrayTypeData member for typinfo.TTypeData structure
tests:
  - add a test which checks RTTI information for 2 dimension array

git-svn-id: trunk@24458 -
2013-05-07 09:12:18 +00:00
paul
da35b3c601 compiler, rtl: write CodePage for AnsiString RTTI (Delphi compatible), change TTypeData appropriately + test
git-svn-id: trunk@24444 -
2013-05-05 05:05:08 +00:00
paul
d90445e5ee compiler, rtl, tests: write Delphi compatible (more or less) type information for Class Reference and Pointer types (mantis #0024367)
git-svn-id: trunk@24421 -
2013-05-04 12:47:05 +00:00
sergei
8c91cddfc8 * Win64 SEH: Fixed handling control flow statements also in 'except' and 'on' parts of try..except statements.
git-svn-id: trunk@24398 -
2013-05-01 01:47:01 +00:00
sergei
c7937f6736 * Win64 exception handling: don't reset fc_unwind control flow flag at the beginning of try..except blocks. Resolves #24342.
git-svn-id: trunk@24385 -
2013-04-30 03:56:58 +00:00
nickysn
3853d06ac0 + added n8086cal.pas, based on n386cal.pas; this pulls in nx86cal.pas as well and fixes compilation of the system unit on i8086 after the merge of the i8086 branch to trunk
git-svn-id: trunk@24335 -
2013-04-26 20:19:57 +00:00
florian
0e41df598e * merge i8086 branch by Nikolay Nikolov
git-svn-id: trunk@24324 -
2013-04-25 20:23:51 +00:00
paul
76c537ee38 tests: rename test files to make them run by testsuite
git-svn-id: trunk@24251 -
2013-04-15 08:10:22 +00:00
michael
0490480523 * Test for 24274
git-svn-id: trunk@24250 -
2013-04-15 07:42:55 +00:00
paul
71b853065a tests: improve dot units test
git-svn-id: trunk@24248 -
2013-04-15 06:48:17 +00:00
florian
2fdd3e2d0a + introduce tvariantrecbranch to be able to store
all needed information for iso compatible variant records
* new for variant records as required by iso pascal
+ tests

git-svn-id: trunk@24241 -
2013-04-14 15:50:42 +00:00
Jonas Maebe
b9ed22b705 * CodeWarrior apparently supports a combination of FPC-like using the
function result as a variable, and Delphi/TP-like "using the function name
    inside the function means a recursive call". In order to prevent
    confusion, we no longer support the former behaviour since r21817
    because the conditions under which one or the other holds are not well
    defined and it's easier to fix a compiler error then to discover why
    a recursive function call doesn't do anything (mantis #22344)

git-svn-id: trunk@24182 -
2013-04-07 15:51:02 +00:00
nickysn
db35b011a3 * modified test cpu16/addint1.pp to not halt on the first error
git-svn-id: branches/i8086@24162 -
2013-04-06 09:46:42 +00:00
nickysn
fdc13a77a5 + first test for CPUs with a 16-bit native int added
git-svn-id: branches/i8086@24161 -
2013-04-05 23:28:02 +00:00
michael
95e6be9853 * Patch from Laco to enhance test for bug #24096
git-svn-id: trunk@24129 -
2013-04-02 11:28:03 +00:00
sergei
37a347ce7b * Another fix to PIC assembler: GOT slot stores the address of variable, not variable itself.
git-svn-id: trunk@24127 -
2013-04-02 10:48:58 +00:00
Jonas Maebe
e621bff943 * don't make a deep copy of records (and in the future, objects) in with-
statements on the JVM target (mantis #24089)

git-svn-id: trunk@23945 -
2013-03-20 16:23:25 +00:00
florian
d5985b4f0e * patch by Christophe Staïesse to implement more ISO-like read behaviour in iso mode, resolves #24060
git-svn-id: trunk@23884 -
2013-03-17 08:27:21 +00:00
pierre
9c855c7c94 accept anyfile that has the same upeercase name for the mkAmbiguous case if FileNameCaseSensitive is true
git-svn-id: trunk@23683 -
2013-03-03 18:53:12 +00:00
pierre
72e81d4be8 Add netbsd x86_64 objects
git-svn-id: trunk@23679 -
2013-03-01 16:24:19 +00:00
pierre
e0f2953380 Add missing object files for haiku-i386
git-svn-id: trunk@23678 -
2013-03-01 16:07:25 +00:00
yury
0ed82d7218 * Use cwstring on unix.
git-svn-id: trunk@23672 -
2013-02-28 19:32:06 +00:00
yury
9ef9c395c6 * Cleanup on exit.
git-svn-id: trunk@23618 -
2013-02-14 14:05:01 +00:00
yury
eae9c8df3c * Fixed typo.
git-svn-id: trunk@23617 -
2013-02-14 13:43:31 +00:00
yury
6b2fbff155 * Use cp1253 instead of cp1252 for tests. For unknown reason there is no Euro symbol in cp1252 on Unix systems (libiconv bug?). Greek cp1253 has Euro symbol as expected.
git-svn-id: trunk@23616 -
2013-02-14 11:39:13 +00:00
yury
fd873c2ee0 * Fixed compilation on targets where sizeof(cextended)=12.
git-svn-id: trunk@23614 -
2013-02-14 10:14:21 +00:00
yury
677c890aff + Added test obj files for android-i386.
git-svn-id: trunk@23611 -
2013-02-13 19:37:00 +00:00
yury
e88bc322bc + Merge the targetandroid branch. Support for arm and i386 android targets.
***************************************************************************

Revision: 23518
Author: yury
Date: 25 Jan 2013 0:14:31
Message:
* Build databases support for Android.
----
Modified : /branches/targetandroid/packages/dblib/fpmake.pp
Modified : /branches/targetandroid/packages/fcl-db/fpmake.pp

Revision: 23516
Author: yury
Date: 24 Jan 2013 23:08:12
Message:
* again made less complex for arm and sparc so it compiles there too without running out of registers.
----
Modified : /branches/targetandroid/tests/webtbs/tw2242.pp

Revision: 23515
Author: yury
Date: 24 Jan 2013 23:01:36
Message:
* Disabled the test for Android.
----
Modified : /branches/targetandroid/tests/webtbs/tw4038.pp

Revision: 23514
Author: yury
Date: 24 Jan 2013 22:32:39
Message:
* Disabled the test for Android.

----
Modified : /branches/targetandroid/tests/test/packages/webtbs/tw14265.pp

Revision: 23512
Author: yury
Date: 24 Jan 2013 12:30:07
Message:
* Allow passing of double quoted paths in TEST_OPT.
----
Modified : /branches/targetandroid/tests/Makefile
Modified : /branches/targetandroid/tests/Makefile.fpc

Revision: 23511
Author: yury
Date: 24 Jan 2013 12:29:01
Message:
* Fixed building of packages when cross-testing. Pass CROSSOPT to build packages in such case, otherwise options specified in TEST_OPT are used to build fpmake. The source compiler not always accepts target options. For example -Cfsoft option, often used for arm compiler, is not accepted by x86 compiler.
----
Modified : /branches/targetandroid/tests/tstunits/Makefile
Modified : /branches/targetandroid/tests/tstunits/Makefile.fpc

Revision: 23497
Author: yury
Date: 22 Jan 2013 19:10:54
Message:
* Reverted r23400 and r23401. Tomas has promised to commit more correct fix to trunk.
----
Modified : /branches/targetandroid/rtl/inc/fexpand.inc
Modified : /branches/targetandroid/tests/test/units/dos/tfexpand.pp

Revision: 23496
Author: yury
Date: 22 Jan 2013 19:05:51
Message:
* Disabled the test for Android.
----
Modified : /branches/targetandroid/tests/webtbs/tw0876.pp

Revision: 23495
Author: yury
Date: 22 Jan 2013 18:58:30
Message:
* Add %delfiles for proper clean-up.
----
Modified : /branches/targetandroid/tests/tbs/tb0582.pp
Modified : /branches/targetandroid/tests/test/tweaklib2.pp
Modified : /branches/targetandroid/tests/webtbs/tw12704b.pp
Modified : /branches/targetandroid/tests/webtbs/tw13628b.pp
Modified : /branches/targetandroid/tests/webtbs/tw14798.pp
Modified : /branches/targetandroid/tests/webtbs/tw16263b.pp
Modified : /branches/targetandroid/tests/webtbs/tw16949b.pp
Modified : /branches/targetandroid/tests/webtbs/tw2812.pp
Modified : /branches/targetandroid/tests/webtbs/tw3082.pp
Modified : /branches/targetandroid/tests/webtbs/tw3402.pp
Modified : /branches/targetandroid/tests/webtbs/tw6586b.pp
Modified : /branches/targetandroid/tests/webtbs/tw6822b.pp
Modified : /branches/targetandroid/tests/webtbs/tw7838b.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730d.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089c.pp

Revision: 23492
Author: yury
Date: 22 Jan 2013 16:43:42
Message:
* Turn off special handling of interrupt calling convention for i386-android.
----
Modified : /branches/targetandroid/compiler/i386/n386cal.pas
Modified : /branches/targetandroid/compiler/x86/cgx86.pas

Revision: 23491
Author: yury
Date: 22 Jan 2013 16:34:32
Message:
* Added %delfiles for proper clean-up.
----
Modified : /branches/targetandroid/tests/test/targ1b.pp
Modified : /branches/targetandroid/tests/test/tlib1b.pp
Modified : /branches/targetandroid/tests/test/tlib2b.pp
Modified : /branches/targetandroid/tests/test/tlibrary2.pp
Modified : /branches/targetandroid/tests/test/tlibrary3.pp
Modified : /branches/targetandroid/tests/test/units/sysutils/texec2.pp

Revision: 23490
Author: yury
Date: 22 Jan 2013 16:28:00
Message:
* These libs are for tests, that run only on windows. Mark libs for windows only as well.

----
Modified : /branches/targetandroid/tests/test/library/tlib3a.pp
Modified : /branches/targetandroid/tests/test/library/tlib3b.pp

Revision: 23489
Author: yury
Date: 22 Jan 2013 16:18:56
Message:
* Do not copy a library to a remote target if this library name is specified using %DELFILES directive.
----
Modified : /branches/targetandroid/tests/utils/dotest.pp

Revision: 23488
Author: yury
Date: 22 Jan 2013 15:47:52
Message:
* Implemented { %DELFILES file1 file2 ... } directive for tests. Primarily it is needed to delete shared libraries used by tests when TEST_DELTEMP=1. When testing on a real Android device, it is not good to run tests on flash memory partitions. Android devices have 1Mb RAM based tempfs partition for /tmp folder, which is ideal for running tests. Since 1Mb is very small size these days, it is needed to clean all test leftovers. Test shared libraries are the biggest leftovers and this new DELFILES directive will help to delete them.
* During remote execution, use && as a command separator after important commands such as CD to ensure that the command succeeded before running other commands. Group other commands using curly braces { }.
----
Modified : /branches/targetandroid/tests/readme.txt
Modified : /branches/targetandroid/tests/utils/dotest.pp
Modified : /branches/targetandroid/tests/utils/testu.pp

Revision: 23487
Author: yury
Date: 22 Jan 2013 13:16:22
Message:
* Define CExtended and clongdouble as double for Android.
----
Modified : /branches/targetandroid/compiler/psystem.pas
Modified : /branches/targetandroid/rtl/inc/ctypes.pp

Revision: 23486
Author: yury
Date: 22 Jan 2013 13:14:36
Message:
* Fixed compilation for case when extended <> cextended.
----
Modified : /branches/targetandroid/tests/test/cg/tcalext6.pp

Revision: 23485
Author: yury
Date: 22 Jan 2013 12:41:43
Message:
* More correct comparison of long double values for case when long double=double in C.
----
Modified : /branches/targetandroid/tests/test/cg/tcalext.pp

Revision: 23484
Author: yury
Date: 22 Jan 2013 11:53:41
Message:
* Do not pass -f switch for rm when testing via adb, since default android shell do not support -f switch.
----
Modified : /branches/targetandroid/tests/utils/dotest.pp

Revision: 23483
Author: yury
Date: 22 Jan 2013 11:47:31
Message:
* Added ICU version of Android 4.1.
* Increment by 2 when finding an unknown ICU version.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp

Revision: 23479
Author: yury
Date: 21 Jan 2013 14:29:40
Message:
* Add define for android.
----
Modified : /branches/targetandroid/tests/test/cg/tcalcst6.pp
Modified : /branches/targetandroid/tests/test/cg/tcalvar6.pp

Revision: 23478
Author: yury
Date: 21 Jan 2013 14:22:06
Message:
+ Added C object files for android-i386.
----
Added : /branches/targetandroid/tests/test/cg/obj/android/i386
Modified : /branches/targetandroid/tests/test/cg/obj/readme.txt

Revision: 23477
Author: yury
Date: 21 Jan 2013 14:08:25
Message:
* Add missing checks for android target.
----
Modified : /branches/targetandroid/compiler/aasmdata.pas
Modified : /branches/targetandroid/compiler/aggas.pas
Modified : /branches/targetandroid/compiler/expunix.pas
Modified : /branches/targetandroid/compiler/ncgld.pas
Modified : /branches/targetandroid/compiler/ogelf.pas
Modified : /branches/targetandroid/compiler/systems.pas
Modified : /branches/targetandroid/compiler/x86/agx86att.pas
Modified : /branches/targetandroid/compiler/x86/cgx86.pas
Modified : /branches/targetandroid/compiler/x86/rax86.pas

Revision: 23475
Author: yury
Date: 21 Jan 2013 13:51:09
Message:
* Set android-i368 stack alignment to 16.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas

Revision: 23474
Author: yury
Date: 21 Jan 2013 13:45:29
Message:
* Removed -z relro linker option, since it causes problems.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas

Revision: 23451
Author: yury
Date: 19 Jan 2013 1:32:26
Message:
* Pass some security switches to LD. They are passed by GCC.
* Removed unused function.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas

Revision: 23450
Author: yury
Date: 19 Jan 2013 1:27:45
Message:
* Fixed file description.
----
Modified : /branches/targetandroid/rtl/android/arm/dllprt0.as

Revision: 23449
Author: yury
Date: 19 Jan 2013 1:27:02
Message:
* Simplify arm startup code.
----
Modified : /branches/targetandroid/rtl/android/arm/prt0.as

Revision: 23448
Author: yury
Date: 19 Jan 2013 1:25:58
Message:
* Fixed file description.
----
Modified : /branches/targetandroid/rtl/android/i386/dllprt0.as
Modified : /branches/targetandroid/rtl/android/i386/prt0.as

Revision: 23447
Author: yury
Date: 19 Jan 2013 1:19:29
Message:
* Rewrite initialization code for i386-android. i386-android works.
----
Modified : /branches/targetandroid/rtl/android/i386/dllprt0.as
Modified : /branches/targetandroid/rtl/android/i386/prt0.as

Revision: 23441
Author: yury
Date: 18 Jan 2013 16:51:09
Message:
* Add android to supported targets for assemblers. It fixes assembling for i386-android.
----
Modified : /branches/targetandroid/compiler/arm/agarmgas.pas
Modified : /branches/targetandroid/compiler/i386/cpuelf.pas
Modified : /branches/targetandroid/compiler/x86/agx86att.pas

Revision: 23435
Author: yury
Date: 18 Jan 2013 0:46:23
Message:
* Enable safecall exception handling for arm-android.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas

Revision: 23434
Author: yury
Date: 18 Jan 2013 0:28:59
Message:
* Removed leftover from my experiments (calling directly pascal main).
----
Modified : /branches/targetandroid/rtl/android/arm/prt0.as

Revision: 23433
Author: yury
Date: 17 Jan 2013 23:43:09
Message:
* Uses SysUtils to make executable bigger. Otherwise string pointers for FindResource can be less than $10000. They are treated as IDs in such case and the test will fail.
----
Modified : /branches/targetandroid/tests/test/units/system/tres.pp

Revision: 23429
Author: yury
Date: 17 Jan 2013 18:49:23
Message:
* Thread safety.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp

Revision: 23427
Author: yury
Date: 17 Jan 2013 14:48:03
Message:
* Skip this test for android.
----
Modified : /branches/targetandroid/tests/test/textthr.pp

Revision: 23426
Author: yury
Date: 17 Jan 2013 14:21:51
Message:
* Fixed ifdefs linux to unix.
----
Modified : /branches/targetandroid/tests/test/tstring10.pp
Modified : /branches/targetandroid/tests/test/units/classes/tsetstream.pp
Modified : /branches/targetandroid/tests/test/units/dos/tdos.pp
Modified : /branches/targetandroid/tests/test/units/dos/tidos.pp

Revision: 23425
Author: yury
Date: 17 Jan 2013 14:20:56
Message:
* Enable more tests for android.
----
Modified : /branches/targetandroid/tests/test/packages/webtbs/tw14265.pp
Modified : /branches/targetandroid/tests/test/testfpuc.pp
Modified : /branches/targetandroid/tests/test/textthr.pp
Modified : /branches/targetandroid/tests/test/tlib2a.pp
Modified : /branches/targetandroid/tests/test/tlib2b.pp
Modified : /branches/targetandroid/tests/test/tpoll.pp
Modified : /branches/targetandroid/tests/test/tsafecall1.pp
Modified : /branches/targetandroid/tests/test/tsafecall2.pp
Modified : /branches/targetandroid/tests/test/tsafecall3.pp
Modified : /branches/targetandroid/tests/test/tsafecall4.pp
Modified : /branches/targetandroid/tests/test/units/system/tres.pp
Modified : /branches/targetandroid/tests/test/units/system/tres2.pp
Modified : /branches/targetandroid/tests/test/units/system/tres3.pp

Revision: 23424
Author: yury
Date: 17 Jan 2013 14:02:35
Message:
* Fixed AnsiStrLComp() and AnsiStrLIComp().
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp

Revision: 23423
Author: yury
Date: 17 Jan 2013 13:49:55
Message:
* Fixed stupid copy-paste error.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp

Revision: 23409
Author: yury
Date: 16 Jan 2013 16:46:02
Message:
* Fixed conflict of native android and java android targets.
----
Modified : /branches/targetandroid/utils/fpcm/fpcmake.inc
Modified : /branches/targetandroid/utils/fpcm/fpcmake.ini

Revision: 23406
Author: yury
Date: 16 Jan 2013 15:33:50
Message:
* Set stackalign field.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas

Revision: 23404
Author: yury
Date: 16 Jan 2013 12:57:51
Message:
* Enable more tests for android.
----
Modified : /branches/targetandroid/tests/webtbs/tw0876.pp
Modified : /branches/targetandroid/tests/webtbs/tw12704a.pp
Modified : /branches/targetandroid/tests/webtbs/tw12704b.pp
Modified : /branches/targetandroid/tests/webtbs/tw16263a.pp
Modified : /branches/targetandroid/tests/webtbs/tw16263b.pp
Modified : /branches/targetandroid/tests/webtbs/tw16949a.pp
Modified : /branches/targetandroid/tests/webtbs/tw16949b.pp
Modified : /branches/targetandroid/tests/webtbs/tw6586a.pp
Modified : /branches/targetandroid/tests/webtbs/tw6586b.pp
Modified : /branches/targetandroid/tests/webtbs/tw6822c.pp
Modified : /branches/targetandroid/tests/webtbs/tw7838a.pp
Modified : /branches/targetandroid/tests/webtbs/tw7838b.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730a.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730b.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730c.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730d.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089a.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089b.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089c.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089d.pp
Modified : /branches/targetandroid/tests/webtbs/uw2364.pp

Revision: 23402
Author: yury
Date: 16 Jan 2013 12:50:52
Message:
* Use collation when comparing strings.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp

Revision: 23401
Author: yury
Date: 16 Jan 2013 12:41:32
Message:
* If there is no HOME directory, the current dir must be used.
----
Modified : /branches/targetandroid/tests/test/units/dos/tfexpand.pp

Revision: 23400
Author: yury
Date: 16 Jan 2013 12:40:25
Message:
* Fixed expanding ~ if there is no HOME env var set.
----
Modified : /branches/targetandroid/rtl/inc/fexpand.inc

Revision: 23391
Author: yury
Date: 15 Jan 2013 14:12:56
Message:
* Make sure that the thread has been started, before destroying the event.
----
Modified : /branches/targetandroid/tests/test/tbrtlevt.pp

Revision: 23390
Author: yury
Date: 15 Jan 2013 13:55:24
Message:
* Do not use DOS code pages for Android. Now all CP string tests pass on Android.
----
Modified : /branches/targetandroid/tests/test/tcpstr17.pp
Modified : /branches/targetandroid/tests/test/tcpstrconcat3.pp
Modified : /branches/targetandroid/tests/test/tcpstrconcatmulti.pp
Modified : /branches/targetandroid/tests/test/tcpstrconcatmulti2.pp

Revision: 23389
Author: yury
Date: 15 Jan 2013 13:53:50
Message:
* Use more common code pages 1251 and 1252 instead of old DOS code pages (not available on Android). There is Euro symbol character that has different code in 1251 and 1252 code pages. Use it for tests.
----
Modified : /branches/targetandroid/tests/test/tcpstr1.pp
Modified : /branches/targetandroid/tests/test/tcpstransistrcompare.pp
Modified : /branches/targetandroid/tests/test/tcpstransistrcompareequal.pp

Revision: 23386
Author: yury
Date: 15 Jan 2013 10:22:30
Message:
* Skip 2 tests for android, since they require local execution.
----
Modified : /branches/targetandroid/tests/test/tcpstr19.pp
Modified : /branches/targetandroid/tests/test/tcpstr9.pp

Revision: 23385
Author: yury
Date: 15 Jan 2013 10:20:43
Message:
* Fixed running library tests on android.
----
Modified : /branches/targetandroid/tests/utils/dotest.pp

Revision: 23382
Author: yury
Date: 14 Jan 2013 16:20:44
Message:
* Implemented Unicode string manager for Android. It uses ICU library libicuuc.so. Note: ICU on Android has limited number of code pages. So don't expect support for DOS code pages or other exotic code pages.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp

Revision: 23301
Author: yury
Date: 2 Jan 2013 20:47:09
Message:
* I've found that libc on Android does not implement widechar case functions such as towupper(). Such functions are just wrappers over regular char functions. Therefore the whole cwstring unit is useless for Android. For now I've added stub cwstring unit for Android and reverted all Android specific changes in unix/cwstring.pp. Later, Unicode manager for Androud should be implemented using libicuuc, which is default Android lib.
----
Added : /branches/targetandroid/rtl/android/cwstring.pp
Modified : /branches/targetandroid/rtl/unix/cwstring.pp

Revision: 23299
Author: yury
Date: 2 Jan 2013 19:38:08
Message:
* Android does not have libiconv, so don't use it in cwstring unit. For now support only UTF-8 code page in ansistrings. Later it is possible to use libicuuc for code page conversions on Android.
----
Modified : /branches/targetandroid/rtl/unix/cwstring.pp

Revision: 23298
Author: yury
Date: 2 Jan 2013 17:41:36
Message:
* Added uuchar unit to build for android.
----
Modified : /branches/targetandroid/rtl/android/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile.fpc

Revision: 23289
Author: yury
Date: 2 Jan 2013 2:53:36
Message:
* Always specify dynamic linker name for executables.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas

Revision: 23288
Author: yury
Date: 2 Jan 2013 2:04:41
Message:
* Updated Makefile
----
Modified : /branches/targetandroid/rtl/android/Makefile

Revision: 23287
Author: yury
Date: 2 Jan 2013 2:03:42
Message:
* cprt0.as is not needed, since we link to libc always.
----
Modified : /branches/targetandroid/rtl/android/Makefile.fpc

Revision: 23286
Author: yury
Date: 2 Jan 2013 2:01:43
Message:
* cprt0.as is not needed, since we link to libc always.
----
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Deleted : /branches/targetandroid/rtl/android/arm/cprt0.as
Deleted : /branches/targetandroid/rtl/android/i386/cprt0.as

Revision: 23285
Author: yury
Date: 2 Jan 2013 1:59:48
Message:
* libctype is not needed, since only bionic is supported anyway.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas

Revision: 23284
Author: yury
Date: 2 Jan 2013 1:49:12
Message:
* Rework of Android startup code. It is needed to always link to libc on android to implement finalization and environment variables in shared libraries.
* Cleanup of Android linker.
* Use only INSERT command in the linker script to inject custom .fpc sections. Whole linker script duplication is nor needed anymore.
* Use BFD linker, since GOLD linker does not support INSERT command. Other incompatibilities may also exist.
* Enable tf_smartlink_sections for i386-android.
* i386-android is broken after this commit. Will be fixed later.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Modified : /branches/targetandroid/rtl/android/arm/dllprt0.as
Modified : /branches/targetandroid/rtl/android/arm/prt0.as

Revision: 23283
Author: yury
Date: 2 Jan 2013 1:48:07
Message:
* Enable weak externals for android.
----
Modified : /branches/targetandroid/compiler/systems.pas

Revision: 23236
Author: yury
Date: 28 Dec 2012 12:42:27
Message:
* Oops, wrong commit r23235. Reverted. Now correct: Fixed lineinfo for Android.
----
Modified : /branches/targetandroid/rtl/inc/exeinfo.pp
Modified : /branches/targetandroid/tests/test/units/sysutils/texec2.pp

Revision: 23235
Author: yury
Date: 28 Dec 2012 11:38:04
Message:
* Fixed lineinfo for Android.
----
Modified : /branches/targetandroid/tests/test/units/sysutils/texec2.pp

Revision: 23232
Author: yury
Date: 27 Dec 2012 22:52:26
Message:
* Fixed the test for android.
----
Modified : /branches/targetandroid/tests/test/units/dos/tdos2.pp

Revision: 23231
Author: yury
Date: 27 Dec 2012 22:51:32
Message:
+ Added C object files for arm-android.
----
Added : /branches/targetandroid/tests/test/cg/obj/android
Added : /branches/targetandroid/tests/test/cg/obj/android/arm
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/cpptcl1.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/cpptcl2.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/ctest.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext3.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext4.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext5.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext6.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/cpptcl1.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/cpptcl2.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/ctest.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext3.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext4.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext5.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext6.o

Revision: 23226
Author: yury
Date: 27 Dec 2012 10:17:06
Message:
* Support for running tests on a remote Android device using ADB.
----
Modified : /branches/targetandroid/tests/Makefile
Modified : /branches/targetandroid/tests/Makefile.fpc
Modified : /branches/targetandroid/tests/readme.txt
Modified : /branches/targetandroid/tests/tstunits/Makefile
Modified : /branches/targetandroid/tests/utils/dotest.pp

Revision: 22048
Author: tom_at_work
Date: 9 Aug 2012 17:13:51
Message:
re-apply the changes of r22045 to correct files after recent revert
----
Modified : /branches/targetandroid/rtl/android/arm/cprt0.as
Added : /branches/targetandroid/rtl/android/i386
Added : /branches/targetandroid/rtl/android/i386/cprt0.as
Added : /branches/targetandroid/rtl/android/i386/dllprt0.as
Added : /branches/targetandroid/rtl/android/i386/prt0.as

Revision: 22047
Author: tom_at_work
Date: 9 Aug 2012 16:57:34
Message:
- revert r22045: applied changes to wrong files, i.e. linux system files, instead of android ones
----
Modified : /branches/targetandroid/rtl/android/arm/cprt0.as
Modified : /branches/targetandroid/rtl/linux/i386/cprt0.as
Added : /branches/targetandroid/rtl/linux/i386/cprt21.as
Added : /branches/targetandroid/rtl/linux/i386/gprt21.as

Revision: 22045
Author: tom_at_work
Date: 9 Aug 2012 11:05:38
Message:
Made cprt0 startup files to compile. Static executables using them likely do not work though.
Removed obsolete startup files (?prt21*).

----
Modified : /branches/targetandroid/rtl/android/arm/cprt0.as
Modified : /branches/targetandroid/rtl/linux/i386/cprt0.as
Deleted : /branches/targetandroid/rtl/linux/i386/cprt21.as
Deleted : /branches/targetandroid/rtl/linux/i386/gprt21.as

Revision: 22044
Author: tom_at_work
Date: 9 Aug 2012 11:00:16
Message:
Updated systems/t_android to only recognize the "bionic" libc as valid libc.
Fix uninitialized defdynlinker variable when compiling i386-android causing garbage in the linker script.

----
Modified : /branches/targetandroid/compiler/systems/t_android.pas

Revision: 21296
Author: tom_at_work
Date: 15 May 2012 0:14:12
Message:
* basic android/x86 support
----
Modified : /branches/targetandroid/Makefile
Modified : /branches/targetandroid/compiler/Makefile
Modified : /branches/targetandroid/compiler/i386/cputarg.pas
Modified : /branches/targetandroid/compiler/systems/i_android.pas
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Modified : /branches/targetandroid/compiler/systems.inc
Modified : /branches/targetandroid/compiler/systems.pas
Modified : /branches/targetandroid/compiler/utils/Makefile
Modified : /branches/targetandroid/compiler/utils/ppudump.pp
Modified : /branches/targetandroid/ide/Makefile
Modified : /branches/targetandroid/ide/compiler/Makefile
Modified : /branches/targetandroid/installer/Makefile
Modified : /branches/targetandroid/packages/Makefile
Modified : /branches/targetandroid/packages/fpmkunit/Makefile
Modified : /branches/targetandroid/rtl/Makefile
Modified : /branches/targetandroid/rtl/aix/Makefile
Modified : /branches/targetandroid/rtl/amiga/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Modified : /branches/targetandroid/rtl/beos/Makefile
Modified : /branches/targetandroid/rtl/darwin/Makefile
Modified : /branches/targetandroid/rtl/embedded/Makefile
Modified : /branches/targetandroid/rtl/emx/Makefile
Modified : /branches/targetandroid/rtl/freebsd/Makefile
Modified : /branches/targetandroid/rtl/gba/Makefile
Modified : /branches/targetandroid/rtl/go32v2/Makefile
Modified : /branches/targetandroid/rtl/haiku/Makefile
Modified : /branches/targetandroid/rtl/linux/Makefile
Modified : /branches/targetandroid/rtl/macos/Makefile
Modified : /branches/targetandroid/rtl/morphos/Makefile
Modified : /branches/targetandroid/rtl/nativent/Makefile
Modified : /branches/targetandroid/rtl/nds/Makefile
Modified : /branches/targetandroid/rtl/netbsd/Makefile
Modified : /branches/targetandroid/rtl/netware/Makefile
Modified : /branches/targetandroid/rtl/netwlibc/Makefile
Modified : /branches/targetandroid/rtl/openbsd/Makefile
Modified : /branches/targetandroid/rtl/os2/Makefile
Modified : /branches/targetandroid/rtl/palmos/Makefile
Modified : /branches/targetandroid/rtl/solaris/Makefile
Modified : /branches/targetandroid/rtl/symbian/Makefile
Modified : /branches/targetandroid/rtl/unix/x86.pp
Modified : /branches/targetandroid/rtl/wii/Makefile
Modified : /branches/targetandroid/rtl/win32/Makefile
Modified : /branches/targetandroid/rtl/win64/Makefile
Modified : /branches/targetandroid/rtl/wince/Makefile
Modified : /branches/targetandroid/utils/Makefile
Modified : /branches/targetandroid/utils/dxegen/Makefile
Modified : /branches/targetandroid/utils/fpcm/Makefile
Modified : /branches/targetandroid/utils/fpcm/fpcmmain.pp
Modified : /branches/targetandroid/utils/fpcmkcfg/Makefile
Modified : /branches/targetandroid/utils/fpcres/Makefile
Modified : /branches/targetandroid/utils/fpcreslipo/Makefile
Modified : /branches/targetandroid/utils/fpdoc/Makefile
Modified : /branches/targetandroid/utils/fpmc/Makefile
Modified : /branches/targetandroid/utils/fppkg/Makefile
Modified : /branches/targetandroid/utils/fprcp/Makefile
Modified : /branches/targetandroid/utils/h2pas/Makefile
Modified : /branches/targetandroid/utils/importtl/Makefile
Modified : /branches/targetandroid/utils/instantfpc/Makefile
Modified : /branches/targetandroid/utils/rmwait/Makefile
Modified : /branches/targetandroid/utils/tply/Makefile

Revision: 21066
Author: tom_at_work
Date: 26 Apr 2012 22:05:06
Message:
fix pthreads use with Android: it does not provide some functions. This patch is partially based on the bug report 0021525. Further, fix use of sem_timedwait in cthreads.pp since Android supports it.
----
Modified : /branches/targetandroid/rtl/linux/pthread.inc
Modified : /branches/targetandroid/rtl/unix/cthreads.pp

Revision: 21065
Author: tom_at_work
Date: 26 Apr 2012 16:15:52
Message:
bugfixes:
- do not compile ipc unit for android, not supported
- fix geterrnolocation external name
- implement dummy getdomainname; does not exist in android
- remove wrong 'if defined(android)' clauses
----
Modified : /branches/targetandroid/rtl/android/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Modified : /branches/targetandroid/rtl/fpmake.pp
Modified : /branches/targetandroid/rtl/unix/cwstring.pp
Modified : /branches/targetandroid/rtl/unix/initc.pp
Modified : /branches/targetandroid/rtl/unix/ipc.pp
Modified : /branches/targetandroid/rtl/unix/unix.pp

Revision: 21063
Author: tom_at_work
Date: 26 Apr 2012 12:53:37
Message:
- missing makefile
----
Added : /branches/targetandroid/rtl/android/Makefile

Revision: 21062
Author: tom_at_work
Date: 26 Apr 2012 12:41:13
Message:
- commit missing new files
----
Added : /branches/targetandroid/compiler/systems/i_android.pas
Added : /branches/targetandroid/compiler/systems/t_android.pas
Added : /branches/targetandroid/rtl/android
Added : /branches/targetandroid/rtl/android/Makefile.fpc
Added : /branches/targetandroid/rtl/android/arm
Added : /branches/targetandroid/rtl/android/arm/cprt0.as
Added : /branches/targetandroid/rtl/android/arm/dllprt0.as
Added : /branches/targetandroid/rtl/android/arm/prt0.as

Revision: 21061
Author: tom_at_work
Date: 26 Apr 2012 12:36:42
Message:
- initial support for the android/arm target in the compiler; resulting .so's can be used for Android/ARM app development.
- basic rtl support using system calls
- fp(c)make/fppkg/makefile support

todo:
- revisit systems/t_android.pas: mostly duplicate with t_linux.pas, containing
lots of unnecessary code
- revisit rtl changes
- android ndk header translation import
- better app build/packaging support
- android/x86 support

----
Modified : /branches/targetandroid/Makefile
Modified : /branches/targetandroid/compiler/Makefile
Modified : /branches/targetandroid/compiler/aggas.pas
Modified : /branches/targetandroid/compiler/arm/cputarg.pas
Modified : /branches/targetandroid/compiler/compiler.pas
Modified : /branches/targetandroid/compiler/systems.inc
Modified : /branches/targetandroid/compiler/systems.pas
Modified : /branches/targetandroid/compiler/utils/Makefile
Modified : /branches/targetandroid/compiler/utils/ppudump.pp
Modified : /branches/targetandroid/ide/Makefile
Modified : /branches/targetandroid/ide/compiler/Makefile
Modified : /branches/targetandroid/installer/Makefile
Modified : /branches/targetandroid/packages/Makefile
Modified : /branches/targetandroid/packages/fpmkunit/Makefile
Modified : /branches/targetandroid/packages/fpmkunit/Makefile.fpc
Modified : /branches/targetandroid/packages/fpmkunit/src/fpmkunit.pp
Modified : /branches/targetandroid/packages/fppkg/src/fpmkunitsrc.inc
Modified : /branches/targetandroid/packages/gnome1/fpmake.pp
Modified : /branches/targetandroid/packages/gtk1/fpmake.pp
Modified : /branches/targetandroid/packages/gtk2/fpmake.pp
Modified : /branches/targetandroid/packages/imlib/fpmake.pp
Modified : /branches/targetandroid/packages/opengl/fpmake.pp
Modified : /branches/targetandroid/packages/sdl/fpmake.pp
Modified : /branches/targetandroid/rtl/Makefile
Modified : /branches/targetandroid/rtl/Makefile.fpc
Modified : /branches/targetandroid/rtl/aix/Makefile
Modified : /branches/targetandroid/rtl/amiga/Makefile
Modified : /branches/targetandroid/rtl/beos/Makefile
Modified : /branches/targetandroid/rtl/darwin/Makefile
Modified : /branches/targetandroid/rtl/embedded/Makefile
Modified : /branches/targetandroid/rtl/emx/Makefile
Modified : /branches/targetandroid/rtl/freebsd/Makefile
Modified : /branches/targetandroid/rtl/gba/Makefile
Modified : /branches/targetandroid/rtl/go32v2/Makefile
Modified : /branches/targetandroid/rtl/haiku/Makefile
Modified : /branches/targetandroid/rtl/linux/Makefile
Modified : /branches/targetandroid/rtl/macos/Makefile
Modified : /branches/targetandroid/rtl/morphos/Makefile
Modified : /branches/targetandroid/rtl/nativent/Makefile
Modified : /branches/targetandroid/rtl/nds/Makefile
Modified : /branches/targetandroid/rtl/netbsd/Makefile
Modified : /branches/targetandroid/rtl/netware/Makefile
Modified : /branches/targetandroid/rtl/netwlibc/Makefile
Modified : /branches/targetandroid/rtl/openbsd/Makefile
Modified : /branches/targetandroid/rtl/os2/Makefile
Modified : /branches/targetandroid/rtl/palmos/Makefile
Modified : /branches/targetandroid/rtl/solaris/Makefile
Modified : /branches/targetandroid/rtl/symbian/Makefile
Modified : /branches/targetandroid/rtl/unix/cwstring.pp
Modified : /branches/targetandroid/rtl/unix/initc.pp
Modified : /branches/targetandroid/rtl/unix/ipc.pp
Modified : /branches/targetandroid/rtl/unix/unix.pp
Modified : /branches/targetandroid/rtl/wii/Makefile
Modified : /branches/targetandroid/rtl/win32/Makefile
Modified : /branches/targetandroid/rtl/win64/Makefile
Modified : /branches/targetandroid/rtl/wince/Makefile
Modified : /branches/targetandroid/utils/Makefile
Modified : /branches/targetandroid/utils/dxegen/Makefile
Modified : /branches/targetandroid/utils/fpcm/Makefile
Modified : /branches/targetandroid/utils/fpcm/fpcmake.inc
Modified : /branches/targetandroid/utils/fpcm/fpcmake.ini
Modified : /branches/targetandroid/utils/fpcm/fpcmmain.pp
Modified : /branches/targetandroid/utils/fpcmkcfg/Makefile
Modified : /branches/targetandroid/utils/fpcmkcfg/fppkg.inc
Modified : /branches/targetandroid/utils/fpcres/Makefile
Modified : /branches/targetandroid/utils/fpcreslipo/Makefile
Modified : /branches/targetandroid/utils/fpdoc/Makefile
Modified : /branches/targetandroid/utils/fpmc/Makefile
Modified : /branches/targetandroid/utils/fppkg/Makefile
Modified : /branches/targetandroid/utils/fppkg/fppkg.pp
Modified : /branches/targetandroid/utils/fprcp/Makefile
Modified : /branches/targetandroid/utils/h2pas/Makefile
Modified : /branches/targetandroid/utils/importtl/Makefile
Modified : /branches/targetandroid/utils/instantfpc/Makefile
Modified : /branches/targetandroid/utils/rmwait/Makefile
Modified : /branches/targetandroid/utils/tply/Makefile

git-svn-id: trunk@23604 -
2013-02-13 12:00:15 +00:00
svenbarth
489e038379 Disallow "protected" and "strict protected" in extended records (Delphi compatible).
ptype.pas, parse_record_members:
  * write an error message if "protected" or "strict protected" is encountered
msg/errore.msg:
  + add an error message for disallowed "things" in records

+ added test
* adjusted test (note: according to the bug report this test did not originally have the "protected" section, but it was added by Paul before commiting)

git-svn-id: trunk@23596 -
2013-02-11 18:46:47 +00:00
svenbarth
344571cb4e Added support for type helpers. In non Delphi modes they use "type helper" and in mode Delphi they use "record helper". They can also be used on constants.
symconst.pas:
  + extend "thelpertype" by "ht_type" which tells the code in "pdecobj.parse_extended_type" that a type helper declaration has been parsed
node.pas:
  + add a constant which identifies all constant node types
ptype.pas:
  + read_named_type: add a parameter "hadtypetoken" to tell the code whether a "type" token had been parsed before
  + read_named_type: if an identifier "helper" is parsed we need to check whether "hadtypetoken" is true and the modeswitch "m_class" is set, but the "m_delphi" one is not; in that case we have a "type helper" declaration
pgenutil.pas, generate_specialization:
  * adjust call to read_named_type
pdecl.pas, types_dec:
  * adjust call to read_named_type

pdecobj.pas:
  * parse_extended_type: extend for correct handling of primitive types (includes Delphi compatible handling as well) and reject types that are explicitly not allowed
  * method_dec: require "static" for class methods in type helpers
  * method_doc: allow constructors for type helpers as well
paramgr.pas, tparamanager:
  * set_common_funcretloc_info: handle type helper constructors like record constructors
  * handle_common_ret_in_param: the "self" value of a type helper constructor is also returned in a parameter
pexpr.pas:
  + add a function to postfixoperators which tries to find and apply a type helper for a given type
  * postfixoperators: try to apply type helpers for ordinal constants
  * postfixoperators: use the correct string type for string constants
  * postfixoperators: try to apply type helpers for enum constants
  * postfixoperators: try to apply type helpers for arrays
  * postfixoperators: try to apply type helpers for Variant
  * postfixoperators: try to apply type helpers for pointer types
  * postfixoperators: try to apply type helpers for other types
  * factor: check postfixoperators after _REALNUMBER, _CCHAR, _CWCHAR, _TRUE and _FALSE
  * factor: also check postfixoperators if a _POINT follows a _NIL

symdef.pas, tdefawaresymtablestack.addhelpers:
  * use "generate_objectpascal_helper_key" to generate the key
symtable.pas:
  + add function to generate the key value for the map of extended types using the extended def
  * adjust "search_last_objectpascal_helper" and "search_objectpascal_helper" to handle primitive types as well
  * use the new "generate_objectpascal_helper_key" function to generate the key

pparautl.pas:
  * insert_self_and_vmt_para: don't insert the $vmt symbol for record or type helpers (ToDo: check whether class helpers really need the symbol as well)
  * insert_self_and_vmt_para: pass "self" as var parameter for type helpers as well
psub.pas, generate_bodyentry_block: 
  * also allow type helpers for constructor methods
ncal.pas, tcallnode.gen_self_tree:
  * also use a temp variable for type helper constructors
ncgcal.pas, tcgcallnode.secondcallparan:
  * allow Pointers to be passed as address param if it is the Self value of a type helper extending a pointer type
  * correctly handle the location in case of type helper constructors

+ add tests

git-svn-id: trunk@23580 -
2013-02-06 09:49:35 +00:00
Jonas Maebe
8f96ace589 * fixed -CTauto(g|s)etterprefix automatically generated helpers in case they
have to wrap an existing (g|s)etter that was marked as "abstract" (don't
    mark the helper also as abstract, sicnce it contains code)

git-svn-id: trunk@23545 -
2013-01-30 22:35:59 +00:00
svenbarth
d49b4043ab Implement DECLARED() for generic symbols. This fixes Mantis #21829 . The syntax is SomeGenericType<> for a generic with only one type parameter and SomeGeneric<,[,]*> for a generic with more than one type parameter. Spaces between the commas or brackets are allowed.
scanner.pas, parse_compiler_expr.read_factor:
  + allow "<>" after "declared" (handle "<>" operator specially)
  + count "," to get correct amount of type parameters
  + check together with the count string for symbols 
  + correctly handle dummy symbols

+ added tests

git-svn-id: trunk@23544 -
2013-01-30 16:10:15 +00:00
Jonas Maebe
e7315d035c * inherit po_auto_raised_visibility flag when the visibility of a method is
raised because it was automatically raised in the parent class (can happen
    for the JVM target when letting the compiler generate getters/setters for
    properties)

git-svn-id: trunk@23522 -
2013-01-26 16:52:28 +00:00
yury
bffcf02926 * Disabled the test for Android.
git-svn-id: branches/targetandroid@23514 -
2013-01-24 20:32:39 +00:00
yury
8ae7c5784c * Sync with trunk r23500.
git-svn-id: branches/targetandroid@23501 -
2013-01-23 07:53:13 +00:00
Tomas Hajny
3b60a0f4aa * fix testing for empty HOME directory or HOME pointing to root on Unix
git-svn-id: trunk@23500 -
2013-01-22 23:58:55 +00:00
yury
e4dd41723c * Reverted r23400 and r23401. Tomas has promised to commit more correct fix to trunk.
git-svn-id: branches/targetandroid@23497 -
2013-01-22 17:10:54 +00:00
yury
ee1e6eb4ea * Add %delfiles for proper clean-up.
git-svn-id: branches/targetandroid@23495 -
2013-01-22 16:58:30 +00:00
yury
cbf370008b * Added %delfiles for proper clean-up.
git-svn-id: branches/targetandroid@23491 -
2013-01-22 14:34:32 +00:00
yury
416da91b04 * These libs are for tests, that run only on windows. Mark libs for windows only as well.
git-svn-id: branches/targetandroid@23490 -
2013-01-22 14:28:00 +00:00
yury
475bc2d09d * Fixed compilation for case when extended <> cextended.
git-svn-id: branches/targetandroid@23486 -
2013-01-22 11:14:36 +00:00
yury
fcbefc94e3 * More correct comparison of long double values for case when long double=double in C.
git-svn-id: branches/targetandroid@23485 -
2013-01-22 10:41:43 +00:00
yury
5aa0ba703d * Add define for android.
git-svn-id: branches/targetandroid@23479 -
2013-01-21 12:29:40 +00:00
yury
d022edf32e + Added C object files for android-i386.
git-svn-id: branches/targetandroid@23478 -
2013-01-21 12:22:06 +00:00
paul
7c663af588 compiler: also don't allow record constructors with only default arguments
git-svn-id: trunk@23438 -
2013-01-18 11:59:25 +00:00
paul
1b8369dd99 compiler: don't allow parameterless constructors
git-svn-id: trunk@23436 -
2013-01-18 01:24:04 +00:00
yury
7da7908441 * Uses SysUtils to make executable bigger. Otherwise string pointers for FindResource can be less than $10000. They are treated as IDs in such case and the test will fail.
git-svn-id: branches/targetandroid@23433 -
2013-01-17 21:43:09 +00:00
yury
fa0b2b2c85 * Skip this test for android.
git-svn-id: branches/targetandroid@23427 -
2013-01-17 12:48:03 +00:00
yury
8936ee983c * Fixed ifdefs linux to unix.
git-svn-id: branches/targetandroid@23426 -
2013-01-17 12:21:51 +00:00
yury
d52ead284e * Enable more tests for android.
git-svn-id: branches/targetandroid@23425 -
2013-01-17 12:20:56 +00:00
paul
3a3c10a474 compiler: don't allow constants, methods, class members and properties for local or anonymous records (fixes bug #0023000)
git-svn-id: trunk@23421 -
2013-01-17 09:05:59 +00:00
pierre
53b65300a6 + Add mips-linux gcc compiled objects
git-svn-id: trunk@23419 -
2013-01-17 08:24:07 +00:00
pierre
dcd3783c6e + mispel-linux gcc compiled objects added
git-svn-id: trunk@23418 -
2013-01-17 08:21:24 +00:00
paul
890e91ab8c tests: fix test after allowing record helpers to have constructors
git-svn-id: trunk@23416 -
2013-01-17 01:45:05 +00:00
paul
e9615716c1 compiler: allow constructors in helpers for records
git-svn-id: trunk@23407 -
2013-01-16 13:47:22 +00:00
yury
d26f0552a0 * Sync with trunk r23404.
* Regenerated makefiles.

git-svn-id: branches/targetandroid@23405 -
2013-01-16 13:21:51 +00:00
yury
2e58240861 * If there is no HOME directory, the current dir must be used.
git-svn-id: branches/targetandroid@23401 -
2013-01-16 10:41:32 +00:00
paul
38da152b11 tests: fixed test
git-svn-id: trunk@23396 -
2013-01-16 03:46:35 +00:00
paul
b2a613c17f compiler: implement record constructors + tests
git-svn-id: trunk@23395 -
2013-01-16 02:07:42 +00:00
yury
5254f8e572 * Make sure that the thread has been started, before destroying the event.
git-svn-id: branches/targetandroid@23391 -
2013-01-15 12:12:56 +00:00
yury
4cec8df547 * Do not use DOS code pages for Android. Now all CP string tests pass on Android.
git-svn-id: branches/targetandroid@23390 -
2013-01-15 11:55:24 +00:00
yury
a5182d6487 * Use more common code pages 1251 and 1252 instead of old DOS code pages (not available on Android). There is Euro symbol character that has different code in 1251 and 1252 code pages. Use it for tests.
git-svn-id: branches/targetandroid@23389 -
2013-01-15 11:53:50 +00:00
yury
09e2ec28e6 * Skip 2 tests for android, since they require local execution.
git-svn-id: branches/targetandroid@23386 -
2013-01-15 08:22:30 +00:00
florian
b43b4bb455 + pseudo procedure aligned: tells the compiler to assume that the given parameter is naturally aligned, counterpart of unaligned
git-svn-id: trunk@23310 -
2013-01-04 19:13:24 +00:00
florian
fce9e953b4 + nested exit support
git-svn-id: trunk@23309 -
2013-01-04 19:09:04 +00:00
florian
728c074bd6 * accept with statements with generic variables having a generic parameter type, resolves #21329
git-svn-id: trunk@23243 -
2012-12-28 19:48:33 +00:00
yury
1e78337015 * Oops, wrong commit r23235. Reverted. Now correct: Fixed lineinfo for Android.
git-svn-id: branches/targetandroid@23236 -
2012-12-28 10:42:27 +00:00
yury
fefaef34db * Fixed lineinfo for Android.
git-svn-id: branches/targetandroid@23235 -
2012-12-28 09:38:04 +00:00
yury
17c9af9ec8 * Fixed the test for android.
git-svn-id: branches/targetandroid@23232 -
2012-12-27 20:52:26 +00:00
yury
e76af3a670 + Added C object files for arm-android.
git-svn-id: branches/targetandroid@23231 -
2012-12-27 20:51:32 +00:00
svenbarth
4adb36e8da Add support for generic type constraints. They are currently only useful to stop specialization of a generic. The parsing of a generic is still too lax and needs to be changed in the future...
symconst.pas:
  + extend "tdefoptions" by a "df_genconstraint" which will be used to mark dummy defs that should mainly satisfy the compiler's type checking without to much changes
symsym.pas:
  + add a class "tgenericconstraintdata" which will hold information about the constraints associated with a specific generic type parameter (designed for future extensions)
  + extend "ttypesym" by a reference to a "tgenericconstraintdata" which is written to the ppu only if needed
symtype.pas:
  + add a pointer to "tderef" as this is needed for the ppu reading/writing code for the "tgenericconstraintdata"
pdecl.pas, types_dec:
  + call "parse_generic_parameters" so that constraints are allowed
pgenutil.pas:
  + extend "generate_specialization" by a "parsedpos" to give in the file position of the first parsed parameter (needed for correct error locations when checking the constraints)
  + add an overloaded call of "generate_specialization" to differentiate between the use cases "first parameter parsed by generate_specialization" and "first parameter parsed by other code"; this also allows to write the "fillchar" for the "parampos" parameter only once ( => otherwise a warning is triggered => error in compilation)
  + extend the "parse_generic_specialization_types" by a "poslist" parameter which will contain the positions of all parsed type parameters (can only be used in the case that all parameters are parsed)
  * move the original code of "parse_generic_specialization_types" to a new procedure "parse_generic_specialization_types_internal" which take an additional "parsedpos" parameter which will be added to the "poslist" before all others; "parse_generic_specialization_types" calls this new procedure with a dummy argument (which won't be used)
  + extend "parse_generic_parameters" by the parsing of generic constraints which constructs correct defs for the parameters and fills in the new "tgenericconstraintdata" object for each parameter (note: the "constructor" constraint is only parsed for Delphi compatibility and basically means the same as a "class" constraint... (it's a relict of Delphi.NET))
  * adjust "insert_generic_parameter_types" as specializations and generics can no longer be differed by whether the type parameters are of type "undefineddef"
pdecsub.pas, parse_proc_head, consume_generic_interface:
  * adjust call to "generate_specialization"
  + add a new function "check_generic_constraints" which is used from within "generate_specialization" to ensure that the given specialization parameters are compatible with the constraints of the generic parameters
ptype.pas:
  * single_type: adjust call to "generate_specialization"
  * read_named_type, expr_type: adjust call to "generate_specialization"
  + write_persistent_type_info: don't write typeinfo for constraints
pexpr.pas, sub_expr:
  * adjust call to "generate_specialization"
* adjusted ppudump, because of added "tdefoptions.df_genconstraint" value

+ added tests for generic constraints
* modified test for class helper inside a generic which extends a class type parameter
+ added test for record helper inside a generic which extends a record type parameter

git-svn-id: trunk@23158 -
2012-12-16 13:44:58 +00:00
florian
d4c17ec4e0 + patch by Vojtech Cihak to add csqr function, resolves #23492
+ init function for complex numbers
+ csamevalue function
+ test
+ run tests in units/ucomplex directory

git-svn-id: trunk@23156 -
2012-12-16 10:15:13 +00:00
Jonas Maebe
29095e9dd3 * fixed if-simplication for C-style booleans by considering all values
different from 0 to be "true", instead of only 1 (patch by Jeppe Johansen,
    mantis #23436)

git-svn-id: trunk@23117 -
2012-12-06 15:18:58 +00:00
florian
a9fed57090 * fix sincos for x86-64 windows resolves #23268
* changed to intel assembler to be more readble
* test for sincos extended

git-svn-id: trunk@22925 -
2012-11-04 16:27:29 +00:00
Jonas Maebe
fd8827d379 * prevent compiler crash caused by double freeing after reporting not
overloaded operator errors

git-svn-id: trunk@22833 -
2012-10-23 16:50:30 +00:00
Jonas Maebe
4dd2aff6c6 * explicitly disable overflow checking because that blows up the code far
beyond the 64kb per method limit (so that all tests can be compiled/run
    with the -Co command line parameter to check that functionality against
    false positives)

git-svn-id: trunk@22810 -
2012-10-21 17:56:50 +00:00
Jonas Maebe
027776a708 + test for range checking (and against false positives for overflow checking)
git-svn-id: trunk@22809 -
2012-10-21 17:56:42 +00:00
florian
dc8a3779e5 * restored overwritten test
git-svn-id: trunk@22776 -
2012-10-19 17:32:33 +00:00
florian
92510963da * test uses rax so it is x86-64 only
git-svn-id: trunk@22774 -
2012-10-19 16:48:31 +00:00
florian
a499a30ca9 * fixes to avx support by Torsten Grundke
git-svn-id: trunk@22773 -
2012-10-19 16:45:53 +00:00
pierre
1cfb612513 Add new tests related to nostackframe checks added in commit 22677
git-svn-id: trunk@22678 -
2012-10-16 22:45:41 +00:00
Jonas Maebe
614436d8cb * added pocall_mwpascal to cdecl_pocalls so we no longer have to explicitly
add it everywhere in the paramanagers (where it was often forgotten)
  - removed places where it was explicitly added to cdecl_pocalls checks
  + test

git-svn-id: trunk@22616 -
2012-10-12 08:41:03 +00:00
florian
283ff05127 * merged avx support in inline assembler developed by Torsten Grundke
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +00:00
Jonas Maebe
e9f4b095e1 + explanation for the parameters of is_visible_for_object
* fixed accessibility checking for strict_protected (the class
    in which the access occurs also has to be related to the
    objectdef of which a symbol is accessed) + test

git-svn-id: trunk@22565 -
2012-10-06 16:28:27 +00:00
pierre
6b911b4e43 * MIPS CPU is also less precise for arctan, as arm cpu
git-svn-id: trunk@22530 -
2012-10-03 22:01:52 +00:00
Jonas Maebe
ae56841ee6 * do not apply node CSE to nested loads on high level cpu targets, because
their nested tree already contains the load (subscriptn) for the variable
    itself and there is no clean/easy way to avoid that in a completely
    portable way in ncgnstld + test

git-svn-id: trunk@22519 -
2012-10-02 18:12:24 +00:00
florian
420cd9bd27 + support for <text>^ in iso mode
git-svn-id: trunk@22512 -
2012-10-01 17:18:51 +00:00
Jonas Maebe
a3c936fe5f + rawbytestring/unicodestring overloads for FileCreate and FileOpen.
The WinCE implementation converts the rawbytestring arguments to
    unicodestring and calls unicode OS APIs, while the others convert
    unicodestring arguments to DefaultFileSystemCodePage and call
    single byte OS APIs
  + test for the above

git-svn-id: branches/cpstrrtl@22467 -
2012-09-27 07:54:25 +00:00
Jonas Maebe
e3b97d99c6 * fixed memory leaks in case a TP-style object inherits from another object
type that contains managed types, but this child doesn't contain any
    managed type itself (since r16632, the parent should be considered as a
    field of the child in terms of needing initialization/finalization)

git-svn-id: trunk@22461 -
2012-09-26 14:26:00 +00:00
Jonas Maebe
10d4b8e66f * added "HaltOnNotReleased:=true;" so test exits with an error if not all
memory is released

git-svn-id: trunk@22459 -
2012-09-26 14:16:19 +00:00
svenbarth
88af293155 Fix for Mantis #22160
The cause of the internal error was the following:
We have a generic in an unit ("A") which uses another unit ("B") in the implementation section and this other unit uses unit A in the interface section. Now the generic is specialized in the interface section of B. This leads to the problem that in unit A when it tries to load the globalsymtable of unit B that globalsymtable will be Nil, because parsing of the interface section is not yet finished. Thus the change in pgenutil.pas, specialization_init: if the unit is still "in_interface" the localsymtable needs to be used instead of the globalsymtable.

This doesn't necessarily lead to a compiling test though, as there is the following possibility:
Unit A contains a generic class/record (with methods) and uses unit B in the implementation section. This unit B also contains a generic class/record (with methods) and uses unit A in the implementation section. Both units contain a specialization of the other unit's generic outside of it's own generics (such that generate_specialization is fully triggered). Let's assume compilation starts with unit A and we reach the uses of unit B. Now compilation switches to unit B and completes as unit A is already registered and in compilation. The problem now is that the generic in unit A still contains unresolved forward declarations as the implementation section of A was not yet parsed which will lead to "forward declaration not solved" errors (Note: Delphi compiles this).

The solution to this is the following: if a generic is specialized from another unit which is not in state ms_compiled then the unit of the specialization needs to wait for the unit of the generic. So the specialization's unit adds itself into a list of waiting units of the generic's unit. Now inside "proc_unit" we need to check whether this module is waiting for other modules and if so avoid "finishing" the unit (which means generating the methods of the specialization, generating assembler code and ultimately freeing the scanner and PPU). Now when the generic's unit finishes we need to check whether other modules are waiting for it and finish them (of course it's a bit more complicated in reality, but that pretty much sums it up).

+ globstat.pas: Added an unit which handles the saving and restoring of the global state which was originally inside "parser.pas, compile" so that Don't Repeat Yourself (DRY) is respected.
* fmodule.pas, tmodule: 
  + add fields to keep track of the units the module is waiting for and which modules are waiting for the module
  + add field for the saved global state (raw pointer to avoid circles)
  + add field for the state which is needed to finish the unit (raw pointer to avoid circles)
  + move the code which was used in "parser.pas, compile" after a module was successfully compiled to the new virtual method "end_of_parsing"
+ fppu.pas, tppumodule.end_of_parsing:
  free the ppufile here
* pgenutil.pas:
  + add new procedure "maybe_add_waiting_unit" which adds the specialization's unit to the waiting list of the generic if that unit is not yet compiled
  * generate_specialization: call the new function when we add a new (true) specialization
  * specialization_init: instead of not adding implementation units at all check whether the unit is still parsing the interface section and add the localsymtable in that case
* pmodules.pas:
  * change "proc_unit" to a function which returns "true" if the unit was already finished (no need to wait for other units)
  + move the code from "proc_unit" from "generate_specialization_procs" on to a new procedure "finish_unit" which
  * this procedure is either called immediately in "proc_unit" if the unit does not need to wait for other units or from "finish_unit" itself if a unit that is waiting for the given unit does no longer wait for another module (special care is taken in proc_unit to avoid circles)
* parser.pas, compile:
  * correctly handle the case if an unit is not finished
  * use the new global state functionality from globstat.pas
  * pay special attention when calling "set_current_module" (see comment at that call)

+ add tests from 22160
+ add test for above mentioned "diamond" case

git-svn-id: trunk@22452 -
2012-09-25 09:45:25 +00:00
Jonas Maebe
fe90823b01 * support the "overload" modifier for Objective-C methods
* only check whether the message identifier of an Objective-C method
    matches the one from a method with the same name in a parent class
    if the parameters match (todo: should be refined to "if the
    encoded Objective-C selector names match")

git-svn-id: trunk@22373 -
2012-09-11 21:58:40 +00:00
Jonas Maebe
e7cb2e9a28 * test for mantis #22807 (bug fixed in jasmin)
git-svn-id: trunk@22347 -
2012-09-06 18:50:29 +00:00
florian
8818b58e5d * Bsf/Bsr on x86 handle now correctly 0 as argument, resolves #22783
* generic Bsf implementations handle now correctly 0 as argument
* test extended

git-svn-id: trunk@22327 -
2012-09-05 13:51:45 +00:00
florian
59012afe26 * better heuristics to decide when a mul by a constant shall be replaced by shift/add/sub sequences
git-svn-id: trunk@22300 -
2012-09-03 13:39:52 +00:00
florian
2f8027c63f + more sophisticated code to optimize multiplications on arm
+ the multiplication optimization needs a popcnt function
+ simple test

git-svn-id: trunk@22299 -
2012-09-03 13:39:45 +00:00
florian
b782918434 * first draft to support the popcnt instruction, works so far for x86 with a real popcnt instruction
git-svn-id: trunk@22289 -
2012-09-02 20:59:39 +00:00
florian
728f53daa6 * test file for popcnt
git-svn-id: trunk@22288 -
2012-09-02 20:59:33 +00:00
Jonas Maebe
ab9d68ae3e * always use RIP-relative addressing in x86-64 assembler code
* abort if there's a warning (warnings for wrong/dangerous pic
    will be added in a later commit)

git-svn-id: trunk@22239 -
2012-08-25 15:12:24 +00:00
florian
1da4c0c3ce * SinCos overloads added, resolves #22663
git-svn-id: trunk@22139 -
2012-08-19 22:09:03 +00:00
florian
5b90a02e75 * inherit nf_write/nf_modify in tcallnode.replaceparaload also when replacing parameters
git-svn-id: trunk@22075 -
2012-08-13 15:06:16 +00:00
florian
49b03ea350 * readme updated
git-svn-id: trunk@22008 -
2012-08-04 09:50:13 +00:00
florian
89980e21f3 + binary objects for armhf
git-svn-id: trunk@22007 -
2012-08-04 09:47:37 +00:00
svenbarth
360592d1f4 Some corrections after the loosening of operator overloads:
* check "A op B" and "B op A" again for operators that can be commutative (all binary ones except shl, shr, div, mod, **, / and -)
* also check for Nil for classrefdefs if left side is a pointer (allows "TClass var" <>/= Nil again, after the above changes)
* don't allow overloads for "implicit pointer type <>/= pointer" and the other way around (this fixes non compiling Objective Pascal test tobjc21.pp and also the new toperator87.pp test)
* some formating corrections

+ added test for "TObject <> Pointer"
+ added test for "TClass <>/= Nil"

git-svn-id: trunk@21983 -
2012-07-29 12:38:09 +00:00
svenbarth
b0458b55a3 Loosen the restriction regarding operator overloads by applying a (modified) patch from JC Chu. This fixes Mantis #22359.
The changes are built up in a way that all operators on two given types are not allowed if a default implementation for that operator exists. This implies that there is a possibility to have a overload work for (in this order) type A and B, but not for B and A. This is for example the case for Set + Enum (which seems to have a default implementation) where Enum + Set is allowed. The added tests try to detect as many default implementations as feasible, but can't cover everything...

git-svn-id: trunk@21975 -
2012-07-26 18:02:01 +00:00
sergei
1763309d8e * Fixed test crash with -Cg on non-Darwin targets: the GOT slot stores address of symbol, not its value.
git-svn-id: trunk@21974 -
2012-07-26 14:52:22 +00:00
Jonas Maebe
df2eddd169 * correctly deal with writing debug information in the Stabs writer for class
hierarchies from other units that were compiled without debug information
    in case not all classes from the hierarchy are explicitly used
    (mantis #22495, #21503, #21259)

git-svn-id: trunk@21972 -
2012-07-26 14:27:10 +00:00
Jonas Maebe
bdc62289b4 * the safecall -> cdecl mapping is also activated for x86_64
(tf_safecall_clearstack is set for it) -> also use pocalls_cdecl for it
    and adjust the safecall tests not to try parameter scenarios that are
    unsupported for cdecl

git-svn-id: trunk@21948 -
2012-07-22 16:59:04 +00:00
sergei
21524c56c6 * If subtrahend symbol belongs to current section, generate a RELATIVE relocation instead of PIC_PAIR. Now the corresponding relative expressions in assembler operands compile correctly on all i386 targets (and x86_64 too, although such feature is less important there).
+ Test.

git-svn-id: trunk@21864 -
2012-07-11 09:05:21 +00:00
sergei
34fc366d64 * test/opt/tretopt.pp, test/tasmread.pp: fixed GOT calculation
* test/tcg1.pp: rewrote without PIC, was having the same issue (GOT off by 1), additionally Intel syntax part won't compile anyway. This test is about push/pop encoding, not about PIC.

git-svn-id: trunk@21811 -
2012-07-07 12:03:13 +00:00
Jonas Maebe
3f5ae8b05f * forgot to commit, part of r21765
git-svn-id: trunk@21766 -
2012-07-03 21:23:20 +00:00
Jonas Maebe
882351bb21 * don't insert a conversion to widechar for ansistr[x]:='y' assignments on
the jvm target  (forgot to adapt code after adding ansistring support)

git-svn-id: trunk@21765 -
2012-07-03 21:16:29 +00:00
svenbarth
71c13190e1 Fix for Mantis #22329.
symtable.pas, searchsym_in_class:
* if we found a helper method that has overload defined we should not forget the symbol as there can be a case that no method with that name is defined in the extended class hierarchy
symtable.pas, searchsym_in_record:
* analogous to the above

+ added test given in the issue
+ added analogous test for record helpers

git-svn-id: trunk@21764 -
2012-07-03 16:27:03 +00:00
sergei
b497d53a98 * Fixed GOT address calculation (must take 'pop ecx' instruction into account)
git-svn-id: trunk@21758 -
2012-07-02 14:28:37 +00:00
masta
504a0ce0ca Fix for Mantis #22326
This fixes 64bit shifts on arm with a constant shift value of 0.

The old code would have emitted something like this
mov r0, r0, lsl #32
as 32 is an invalid shift value (and would be wrong anyway) the
assembler declined to assemble the produced source.

The new code will just not emit any code for a shift value of 0.

tests/test/tint642.pp now tests shl/shr 0 on 64 bit values.
tests/webtbs/tw22326.pp is also added as an additional test.

git-svn-id: trunk@21746 -
2012-07-01 08:09:00 +00:00
Jonas Maebe
b0462d27cc * by default, no longer initialize enumeration fields of classes/objects
with the enum instance corresponding to ordinal 0 in JVM constructors,
    because a virtual method called by a parent constructor may already
    have assigned a different value (see tests/test/jvm/tenum2.pp). This
    will result in null pointer exceptions when using such fields without
    first explicitly assigning a value to them though.

    The old behaviour can be restored with the new -CTenumfieldinit command
    line parameter

git-svn-id: trunk@21736 -
2012-06-29 21:24:35 +00:00
svenbarth
cc65ac20c5 Fix for Mantis #22220
ptype.pas:
  * read_named_type:
      allow specializations for pointers in Delphi modes
  * single_type: 
      correctly handle forwarddefs; as we can only specialize generics if
      they are completely defined (srsym<>nil) we don't need to return a 
      forward def, but instead return the specialized def itself
+ added tests to "test" instead of "webtbs" as no explicit tests were given 
  in the report

git-svn-id: trunk@21689 -
2012-06-24 10:35:21 +00:00
svenbarth
2d8796fa1a Added further tests regarding the topic from revision 21687
git-svn-id: trunk@21688 -
2012-06-24 10:27:01 +00:00
svenbarth
8c95ea039f Fix for Mantis #22219
ptype.pas:
  * read_named_type: 
      after reading the type we're pointing to we need to make sure that
      we didn't get a generic dummy symbol; this can happen when parsing
      a pointer declaration as the type in a constant or variable 
      declaration
  * resolve_forward_types:
      when resolving forward types we need to make sure that we weren't
      given a generic dummy to which no non-generic definition was
      given (possible in Delphi mode); for non-Delphi modes we can not
      rely on the generic dummy flag as the typedef of the symbol will
      the generic def
+ added test from the bug reports as well as three additional ones to
  make sure that nothing breaks regarding to forward pointer 
  declarations
      

git-svn-id: trunk@21687 -
2012-06-24 10:08:17 +00:00
Jonas Maebe
d953783a7e * also delete temporary files if the test crashes
git-svn-id: trunk@21680 -
2012-06-22 14:31:48 +00:00
svenbarth
75bf094e3f Fix for Mantis #21064.
* pgenutil.pas: factor out the reading of generic specialization parameters (parse_generic_specialization_types) and the generation of a generic type name (generate_generic_name)
* pdecsub.pas, parse_proc_head:
    * also allow an interface alias declaration if an identifier is followed by a "<" (which starts a specialization)
    + add a procedure "consume_generic_interface" which parses such a specialization (by using "parse_generic_specialization_types") - this is needed, because "consume_generic_type_parameter" can (and should not!) handle "ISomeIntf<Integer, T>" or (somewhen in the future) "ISomeIntf<TSomeOtherGeneric<T>>" - and finds the correct symbol for the interface (by utilizing the "generate_generic_name" function)
    * generate the correct mapping entry (for the generic it's only needed for checking (if any), but for a specialization it's essential that we reference the correct specialization)

+ add tests which were included with the issue and also two additional ones

Note: In non-Delphi modes an interface alias can be done like in Delphi mode; "specialization" is not necessary and furthermore not even allowed!

git-svn-id: trunk@21656 -
2012-06-20 08:35:57 +00:00
svenbarth
d2fabd2a22 Fix for Mantis #21350
+ pgenutil.pas: 
    add a procedure which adds a type symbol to a non-Delphi-mode generic class or record which has the same name as the unit global dummy symbol for that generic. I don't know why I had that idea earlier as this will simplify some of the conditions in the parser again (I haven't changed these yet, but I hope to do that at least when I start working on generic functions).
* pgenutil.pas, generate_specialization:
    correctly handle "specialize TSomeGeneric<T>" as method parameter in a generic with the newly added rename symbol
* pdecobj.pas, object_dec & ptype.pas, record_dec: 
    call the procedure to add the rename symbol (the procedure checks whether the mode is correct)
* ppu.pas: 
    increase PPU version so that we don't use non-Delphi mode units with generics, but without the rename symbol
+ added tests:
    the one in webtbs are for classes/objects and those in test are for records

git-svn-id: trunk@21603 -
2012-06-14 07:07:28 +00:00
Jonas Maebe
769a4ecc6a * reduced complexity/running time of the test
git-svn-id: trunk@21499 -
2012-06-06 18:17:36 +00:00
Tomas Hajny
95bb7a9129 * don't check for returned string in case of wildcards and multiple matches (order depends on the underlying filesystem and not guaranteed)
git-svn-id: trunk@21493 -
2012-06-05 22:24:57 +00:00