]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add regression test
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 8 Oct 2024 13:15:26 +0000 (15:15 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 8 Oct 2024 16:01:22 +0000 (18:01 +0200)
gcc/testsuite/
PR ada/115535
* gnat.dg/put_image1.adb: New test

gcc/testsuite/gnat.dg/put_image1.adb [new file with mode: 0644]

diff --git a/gcc/testsuite/gnat.dg/put_image1.adb b/gcc/testsuite/gnat.dg/put_image1.adb
new file mode 100644 (file)
index 0000000..396967c
--- /dev/null
@@ -0,0 +1,21 @@
+-- { dg-do run }
+-- { dg-options "-gnat2022" }
+
+with Ada.Text_IO; use Ada.Text_IO;
+
+procedure Put_Image1 is
+
+  type Client_ID_Part is range 0 .. 2**32 - 1 with Size => 32;
+
+  type Client_ID is array (1 .. 2) of Client_ID_Part;
+
+  A : Client_ID := (1479222903, 3163714999);
+
+begin
+   Put_Line (A'Image);
+   -- { dg-output ".* 1479222903,  3163714999.*\n" }
+   Put_Line (A (1)'Image);
+   -- { dg-output " 1479222903.*\n" }
+   Put_Line (A (2)'Image);
+   -- { dg-output " 3163714999.*\n" }
+end;