summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/bind_c_usage_2.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/bind_c_usage_2.f03')
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_usage_2.f0315
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_2.f03 b/gcc/testsuite/gfortran.dg/bind_c_usage_2.f03
new file mode 100644
index 000000000..e76215e7f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_2.f03
@@ -0,0 +1,15 @@
+! { dg-do compile }
+use, intrinsic :: iso_c_binding
+type, bind(c) :: mytype
+ integer(c_int) :: j
+end type mytype
+
+type(mytype), bind(c) :: mytype_var ! { dg-error "cannot be BIND.C." }
+
+integer(c_int), bind(c) :: i ! { dg-error "cannot be declared with BIND.C." }
+integer(c_int), bind(c), dimension(10) :: my_array ! { dg-error "cannot be BIND.C." }
+
+common /COM/ i
+bind(c) :: /com/
+
+end