mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 12:07:58 +02:00
24 lines
323 B
ObjectPascal
24 lines
323 B
ObjectPascal
{ %FAIL }
|
|
|
|
program tatomic3;
|
|
|
|
{$mode objfpc}
|
|
{$modeswitch advancedrecords}
|
|
|
|
type
|
|
TTest = record
|
|
f: LongInt;
|
|
class operator Inc(const aArg: TTest): TTest;
|
|
end;
|
|
|
|
class operator TTest.Inc(const aArg: TTest): TTest;
|
|
begin
|
|
Result.f := aArg.f + 1;
|
|
end;
|
|
|
|
var
|
|
t: TTest = ( f: 42 );
|
|
begin
|
|
AtomicIncrement(t);
|
|
end.
|