From 6cd6566528cc89a63752d8547fcb2de5781a37ac Mon Sep 17 00:00:00 2001 From: "J. Gareth \"Curious Kit\" Moreton" Date: Tue, 9 Apr 2024 06:41:00 +0100 Subject: [PATCH] * New test based on webtbs/tw38337 that helps catch internal error 200307043 --- tests/webtbs/tw38337.inc | 18 ++++++++++++++++++ tests/webtbs/tw38337.pp | 22 ++-------------------- tests/webtbs/tw38337a.pp | 9 +++++++++ 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 tests/webtbs/tw38337.inc create mode 100644 tests/webtbs/tw38337a.pp diff --git a/tests/webtbs/tw38337.inc b/tests/webtbs/tw38337.inc new file mode 100644 index 0000000000..5e0ea53bf8 --- /dev/null +++ b/tests/webtbs/tw38337.inc @@ -0,0 +1,18 @@ +{$mode objfpc}{$H+} + +function UTF8Length(const s: string): PtrInt; inline; +begin + Result:=9; +end; + + +var + v1: string; + s: shortstring; + i: Integer; +begin + v1 := '123456789'; + s := v1; + for i := 1 to UTF8Length(s)-8 do begin + end; +end. diff --git a/tests/webtbs/tw38337.pp b/tests/webtbs/tw38337.pp index 7d461ddfa9..8eeb98a9f7 100644 --- a/tests/webtbs/tw38337.pp +++ b/tests/webtbs/tw38337.pp @@ -1,20 +1,2 @@ -program fs; - -{$mode objfpc}{$H+} - -function UTF8Length(const s: string): PtrInt; inline; -begin - Result:=9; -end; - - -var - v1: string; - s: shortstring; - i: Integer; -begin - v1 := '123456789'; - s := v1; - for i := 1 to UTF8Length(s)-8 do begin - end; -end. +program tw38337; +{$I tw38337.inc} \ No newline at end of file diff --git a/tests/webtbs/tw38337a.pp b/tests/webtbs/tw38337a.pp new file mode 100644 index 0000000000..5e43babf5c --- /dev/null +++ b/tests/webtbs/tw38337a.pp @@ -0,0 +1,9 @@ +{ %OPT=-O3 } +{ %CPU=i386,x86_64 } + +{ This variant of tw38337 helps to catch out Internal Error 200307043 that + sometimes got triggered during pure function development (even though the + test itself doesn't use a pure function). } + +program tw38337a; +{$I tw38337.inc} \ No newline at end of file