summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/c_loc_tests_15.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_tests_15.f9016
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90 b/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90
new file mode 100644
index 00000000000..63f8816379e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR 44925: [OOP] C_LOC with CLASS pointer
+!
+! Contributed by Barron Bichon <barron.bichon@swri.org>
+
+ use iso_c_binding
+
+ type :: t
+ end type t
+
+ type(c_ptr) :: tt_cptr
+ class(t), pointer :: tt_fptr
+ if (associated(tt_fptr)) tt_cptr = c_loc(tt_fptr) ! { dg-error "must not be polymorphic" }
+
+end