aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/lto/bind_c-1_0.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/lto/bind_c-1_0.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/lto/bind_c-1_0.f9021
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/lto/bind_c-1_0.f90 b/gcc/testsuite/gfortran.dg/lto/bind_c-1_0.f90
new file mode 100644
index 00000000000..79be99a53c5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/bind_c-1_0.f90
@@ -0,0 +1,21 @@
+! { dg-do run }
+! { dg-lto-options {{ -O3 -flto }} }
+! This testcase will abort if C_PTR is not interoperable with both int *
+! and float *
+module lto_type_merge_test
+ use, intrinsic :: iso_c_binding
+ implicit none
+
+ type, bind(c) :: MYFTYPE_1
+ type(c_ptr) :: ptr
+ type(c_ptr) :: ptrb
+ end type MYFTYPE_1
+
+ type(myftype_1), bind(c, name="myVar") :: myVar
+
+contains
+ subroutine types_test() bind(c)
+ myVar%ptr = myVar%ptrb
+ end subroutine types_test
+end module lto_type_merge_test
+