https://gcc.gnu.org/g:57a2bdc28f8c24fa93ea2e6942e6a264afaeee5c

commit r16-4224-g57a2bdc28f8c24fa93ea2e6942e6a264afaeee5c
Author: Eric Botcazou <[email protected]>
Date:   Sun Oct 5 10:42:25 2025 +0200

    Add testcase for PR ada/113536
    
    gcc/testsuite/
            PR ada/113536
            * gnat.dg/reduce2.adb: New test.

Diff:
---
 gcc/testsuite/gnat.dg/reduce2.adb | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gcc/testsuite/gnat.dg/reduce2.adb 
b/gcc/testsuite/gnat.dg/reduce2.adb
new file mode 100644
index 000000000000..0246709ec43a
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/reduce2.adb
@@ -0,0 +1,18 @@
+-- { dg-do compile }
+-- { dg-options "-gnat2022" }
+
+procedure Reduce2 is
+
+  subtype Value is Natural range 0 .. 255;
+
+  function Do_Something (Accumulator : Value; Symbol : Character) return Value
+    is (((Accumulator + Character'Pos (Symbol)) * 17) mod 256);
+
+  function Do_It_By_Reduction (S : String) return Value is
+    (S'Reduce (Do_Something, 0));
+
+  Test_It : constant Value := Do_It_By_Reduction ("Hello, world!");
+
+begin
+  null;
+end;

Reply via email to