diff --git a/flang/module/__fortran_builtins.f90 b/flang/module/__fortran_builtins.f90 --- a/flang/module/__fortran_builtins.f90 +++ b/flang/module/__fortran_builtins.f90 @@ -19,7 +19,7 @@ private :: selected_int_kind integer, parameter, private :: int64 = selected_int_kind(18) - type :: __builtin_c_ptr + type, bind(c) :: __builtin_c_ptr integer(kind=int64) :: __address end type diff --git a/flang/test/Semantics/bind-c07.f90 b/flang/test/Semantics/bind-c07.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Semantics/bind-c07.f90 @@ -0,0 +1,11 @@ +! RUN: bbc -emit-fir -o - %s | FileCheck %s + +module bind_c_type + use, intrinsic :: iso_c_binding + + type, bind(C) :: t + type(c_ptr) :: tcptr = C_NULL_PTR + end type +end module + +! CHECK-LABEL: _QMbind_c_typeE.di.t.tcptr