1{ %opt=-gh } 2{$ifdef go32v2} 3 {$define USE_INTERNAL_UNICODE} 4{$endif} 5 6{$ifdef USE_INTERNAL_UNICODE} 7 {$define USE_FPWIDESTRING_UNIT} 8 {$define USE_UNICODEDUCET_UNIT} 9 {$define USE_CPALL_UNIT} 10{$endif} 11 12program outpar; 13{$ifdef FPC}{$mode objfpc}{$h+}{$endif} 14{$ifdef mswindows}{$apptype console}{$endif} 15uses 16 {$ifdef FPC} 17 {$ifdef unix} 18 cthreads, 19 {$ifndef USE_INTERNAL_UNICODE} 20 {$ifdef darwin}iosxwstr{$else}cwstring{$endif}, 21 {$endif ndef USE_INTERNAL_UNICODE} 22 {$endif} 23 {$endif} 24 {$ifdef USE_UNICODEDUCET_UNIT} 25 unicodeducet, 26 {$endif} 27 {$ifdef USE_FPWIDESTRING_UNIT} 28 fpwidestring, 29 {$endif} 30 {$ifdef USE_CPALL_UNIT} 31 cpall, 32 {$endif} 33 sysutils; 34{$ifndef FPC} 35type 36 sizeint = integer; 37 psizeint = ^sizeint; 38{$endif} 39 40procedure testproc(out str); 41begin 42 ansistring(str):= ''; 43end; 44 45var 46 str1,str2: ansistring; 47 48begin 49 setlength(str1,5); 50 move('abcde',str1[1],5); 51 str2:= str1; 52 testproc(str2); 53 if psizeint(pchar(pointer(str1))-2*sizeof(sizeint))^ <> 1 then 54 Halt(1); 55 if str1<>'abcde' then 56 Halt(2); 57end. 58