sizetype.adb: New test.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 16 Jan 2008 22:14:43 +0000 (22:14 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 16 Jan 2008 22:14:43 +0000 (22:14 +0000)
* gnat.dg/sizetype.adb: New test.

From-SVN: r131580

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

index 155e98eb1c737cb967eac8bcd0c618efc846310c..ed896b49b7eed7bb39783ce1da7bb1ceaad07be9 100644 (file)
@@ -1,3 +1,7 @@
+2008-01-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/sizetype.adb: New test.
+
 2008-01-16  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/32628
diff --git a/gcc/testsuite/gnat.dg/sizetype.adb b/gcc/testsuite/gnat.dg/sizetype.adb
new file mode 100644 (file)
index 0000000..acc2d65
--- /dev/null
@@ -0,0 +1,14 @@
+-- { dg-do run }
+
+with Interfaces.C; use Interfaces.C;
+
+procedure Sizetype is
+
+   TC_String : String(1..8) := "abcdefgh";
+   TC_No_nul : constant char_array := To_C(TC_String, False);
+begin
+   if TC_No_nul(0) /= To_C('a') then
+      raise Program_Error;
+   end if;
+end;