From 186bd3c3efa2f644fd9ef4afd1820607f39c8651 Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 3 Sep 2007 15:55:26 +0000 Subject: * fixed mantis #9522: no longer allow typecasting ordinal constants to complex types (caused a lot of internal errors later on, and was also Delphi-incompatible) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@8369 3ad0048d-3df7-0310-abae-a5850022a9f2 --- tests/webtbf/tw3812.pp | 18 ++++++++++++++++++ tests/webtbf/tw9522.pp | 7 +++++++ tests/webtbf/tw9522a.pp | 7 +++++++ tests/webtbf/tw9522b.pp | 7 +++++++ tests/webtbf/tw9522c.pp | 7 +++++++ tests/webtbf/tw9522d.pp | 8 ++++++++ tests/webtbf/tw9522e.pp | 8 ++++++++ 7 files changed, 62 insertions(+) create mode 100644 tests/webtbf/tw3812.pp create mode 100644 tests/webtbf/tw9522.pp create mode 100644 tests/webtbf/tw9522a.pp create mode 100644 tests/webtbf/tw9522b.pp create mode 100644 tests/webtbf/tw9522c.pp create mode 100644 tests/webtbf/tw9522d.pp create mode 100644 tests/webtbf/tw9522e.pp (limited to 'tests/webtbf') diff --git a/tests/webtbf/tw3812.pp b/tests/webtbf/tw3812.pp new file mode 100644 index 0000000000..627c097e26 --- /dev/null +++ b/tests/webtbf/tw3812.pp @@ -0,0 +1,18 @@ +{ %fail } + +{ Source provided for Free Pascal Bug Report 3812 } +{ Submitted by "Sergey@michint" on 2005-03-22 } +{ e-mail: } +type + LARGE_INTEGER = record + LowPart : Cardinal; + HighPart : LongInt; + end; + +procedure t(li1: Large_Integer); stdcall; +begin +end; + +begin + t(Large_Integer(1111111111111111)); +end. diff --git a/tests/webtbf/tw9522.pp b/tests/webtbf/tw9522.pp new file mode 100644 index 0000000000..b37efbb109 --- /dev/null +++ b/tests/webtbf/tw9522.pp @@ -0,0 +1,7 @@ +{ %fail } + +type T4Char = array[0..3] of char; +begin + writeln(T4Char(65)[0]); +end. + diff --git a/tests/webtbf/tw9522a.pp b/tests/webtbf/tw9522a.pp new file mode 100644 index 0000000000..18ad6dd6aa --- /dev/null +++ b/tests/webtbf/tw9522a.pp @@ -0,0 +1,7 @@ +{ %fail } + +type T4Char = array[0..3] of char; +begin + writeln(ansistring(65)); +end. + diff --git a/tests/webtbf/tw9522b.pp b/tests/webtbf/tw9522b.pp new file mode 100644 index 0000000000..e57bc8df6b --- /dev/null +++ b/tests/webtbf/tw9522b.pp @@ -0,0 +1,7 @@ +{ %fail } + +type ts = set of 0..7; +begin + writeln(1 in ts(65)); +end. + diff --git a/tests/webtbf/tw9522c.pp b/tests/webtbf/tw9522c.pp new file mode 100644 index 0000000000..56fc0bd93a --- /dev/null +++ b/tests/webtbf/tw9522c.pp @@ -0,0 +1,7 @@ +{ %fail } + +type ts = string[1]; +begin + writeln(ts(65)); +end. + diff --git a/tests/webtbf/tw9522d.pp b/tests/webtbf/tw9522d.pp new file mode 100644 index 0000000000..a58cedf269 --- /dev/null +++ b/tests/webtbf/tw9522d.pp @@ -0,0 +1,8 @@ +{ %fail } + +type + tr = record b: byte; end; +begin + writeln(tr(65).b); +end. + diff --git a/tests/webtbf/tw9522e.pp b/tests/webtbf/tw9522e.pp new file mode 100644 index 0000000000..95c344ffe4 --- /dev/null +++ b/tests/webtbf/tw9522e.pp @@ -0,0 +1,8 @@ +{ %fail } + +type + tobj = object b : byte; end; +begin + writeln(tobj(65).b); +end. + -- cgit v1.2.1