diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2009-06-21 12:14:14 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2009-06-21 12:14:14 +0000 |
commit | ff955e9626180d662cf587ead87bf70172ffcc1a (patch) | |
tree | 967defaf844db62ecf4727ff7585405ff274e8fa /tests/test/opt | |
parent | 5b765f2b88aa2727725e1c31c3327a3aba75f1a0 (diff) | |
download | fpc-ff955e9626180d662cf587ead87bf70172ffcc1a.tar.gz |
+ test I forgot to commit earlier
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13309 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'tests/test/opt')
-rw-r--r-- | tests/test/opt/twpo6.pp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/test/opt/twpo6.pp b/tests/test/opt/twpo6.pp new file mode 100644 index 0000000000..6b22d02bd1 --- /dev/null +++ b/tests/test/opt/twpo6.pp @@ -0,0 +1,51 @@ +{ %wpoparas=devirtcalls,optvmts } +{ %wpopasses=1 } + +{$mode objfpc} +{$m+} + +{ check that multiple descendents properly mark parent class method as + non-optimisable +} + +type + tbase = class + procedure test; virtual; + end; + + tchild1 = class(tbase) + procedure test; override; + end; + + tchild2 = class(tbase) + published + procedure test; override; + end; + +procedure tbase.test; +begin + halt(1); +end; + +var + a: longint; + +procedure tchild1.test; +begin + if a<>1 then + halt(2); +end; + +procedure tchild2.test; +begin + if a<>2 then + halt(3); +end; + +var + bb: tbase; +begin + bb:=tchild1.create; + if (bb is tchild2) then + halt(1); +end. |