From d891ab1bc87bc5d855f6ee18337e517a2a90d759 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 23 Oct 2021 05:40:09 -0700 Subject: Move bind-c-intent-out-2.f90 to gfortran.dg/ubsan Move bind-c-intent-out-2.f90 to gfortran.dg/ubsan for -fsanitize=undefined. PR fortran/9262 * gfortran.dg/bind-c-intent-out-2.f90: Moved to ... * gfortran.dg/ubsan/bind-c-intent-out-2.f90 --- gcc/testsuite/gfortran.dg/bind-c-intent-out-2.f90 | 39 ---------------------- .../gfortran.dg/ubsan/bind-c-intent-out-2.f90 | 39 ++++++++++++++++++++++ 2 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 gcc/testsuite/gfortran.dg/bind-c-intent-out-2.f90 create mode 100644 gcc/testsuite/gfortran.dg/ubsan/bind-c-intent-out-2.f90 (limited to 'gcc') diff --git a/gcc/testsuite/gfortran.dg/bind-c-intent-out-2.f90 b/gcc/testsuite/gfortran.dg/bind-c-intent-out-2.f90 deleted file mode 100644 index fe8f606..0000000 --- a/gcc/testsuite/gfortran.dg/bind-c-intent-out-2.f90 +++ /dev/null @@ -1,39 +0,0 @@ -! { dg-do run } -! { dg-additional-options "-fsanitize=undefined -fcheck=all" } - -! PR fortran/92621 - -subroutine hello(val) bind(c) - use, intrinsic :: iso_c_binding, only: c_int - - implicit none - - integer(kind=c_int), allocatable, intent(out) :: val(:) - - allocate(val(1)) - val = 2 - return -end subroutine hello - -program alloc_p - - use, intrinsic :: iso_c_binding, only: c_int - - implicit none - - interface - subroutine hello(val) bind(c) - import :: c_int - implicit none - integer(kind=c_int), allocatable, intent(out) :: val(:) - end subroutine hello - end interface - - integer(kind=c_int), allocatable :: a(:) - - allocate(a(1)) - a = 1 - call hello(a) - stop - -end program alloc_p diff --git a/gcc/testsuite/gfortran.dg/ubsan/bind-c-intent-out-2.f90 b/gcc/testsuite/gfortran.dg/ubsan/bind-c-intent-out-2.f90 new file mode 100644 index 0000000..fe8f606 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/ubsan/bind-c-intent-out-2.f90 @@ -0,0 +1,39 @@ +! { dg-do run } +! { dg-additional-options "-fsanitize=undefined -fcheck=all" } + +! PR fortran/92621 + +subroutine hello(val) bind(c) + use, intrinsic :: iso_c_binding, only: c_int + + implicit none + + integer(kind=c_int), allocatable, intent(out) :: val(:) + + allocate(val(1)) + val = 2 + return +end subroutine hello + +program alloc_p + + use, intrinsic :: iso_c_binding, only: c_int + + implicit none + + interface + subroutine hello(val) bind(c) + import :: c_int + implicit none + integer(kind=c_int), allocatable, intent(out) :: val(:) + end subroutine hello + end interface + + integer(kind=c_int), allocatable :: a(:) + + allocate(a(1)) + a = 1 + call hello(a) + stop + +end program alloc_p -- cgit v1.1