aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-07-17 15:06:36 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-07-17 15:06:36 +0000
commit1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f (patch)
tree7c6e299f25c884686c710a82475f43eda7b6e38e /gcc/testsuite
parent73cd74f8e7a9f2c7b6fe38c0b76179f89c363f37 (diff)
downloadgcc-1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f.zip
gcc-1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f.tar.gz
gcc-1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f.tar.bz2
re PR middle-end/49732 (crash on terminal_interface-curses-menus.adb from ncurses with -gnato)
PR middle-end/49732 * tree.c (walk_tree_1) <DECL_EXPR>: Do not walk a pointed-to type. From-SVN: r176371
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/pointer_controlled.adb31
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6abed53..2e5683c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/pointer_controlled.adb: New test.
+
2011-07-17 Tobias Burnus <burnus@net-b.de>
PR fortran/49624
diff --git a/gcc/testsuite/gnat.dg/pointer_controlled.adb b/gcc/testsuite/gnat.dg/pointer_controlled.adb
new file mode 100644
index 0000000..1d85b53
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/pointer_controlled.adb
@@ -0,0 +1,31 @@
+-- PR ada/49732
+-- Testcase by Vorfeed Canal
+
+-- { dg-do compile }
+-- { dg-options "-gnato" }
+
+with Interfaces.C; use Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+with Interfaces.C.Pointers;
+
+procedure Pointer_Controlled is
+
+ function Create (Name : String) return size_t is
+
+ type Name_String is new char_array (0 .. Name'Length);
+ type Name_String_Ptr is access Name_String;
+ pragma Controlled (Name_String_Ptr);
+
+ Name_Str : constant Name_String_Ptr := new Name_String;
+ Name_Len : size_t;
+
+ begin
+ To_C (Name, Name_Str.all, Name_Len);
+ return 1;
+ end;
+
+ Test : size_t;
+
+begin
+ Test := Create("ABC");
+end;