summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/init_flag_16.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/init_flag_16.f03')
-rw-r--r--gcc/testsuite/gfortran.dg/init_flag_16.f0325
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/init_flag_16.f03 b/gcc/testsuite/gfortran.dg/init_flag_16.f03
new file mode 100644
index 00000000000..a39df63d772
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/init_flag_16.f03
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-finit-derived" }
+!
+! PR fortran/82886
+!
+! Test a regression which caused an ICE when -finit-derived was given without
+! other -finit-* flags, especially for derived-type components with potentially
+! hidden basic integer components.
+!
+
+program pr82886
+
+ use, intrinsic :: iso_c_binding, only: c_ptr, c_null_ptr
+ type t
+ type(c_ptr) :: my_c_ptr
+ end type
+
+contains
+
+ subroutine sub0() bind(c)
+ type(t), target :: my_f90_type
+ my_f90_type%my_c_ptr = c_null_ptr
+ end subroutine
+
+end