Debian Codegraph @

gcc/testsuite/gfortran.dg/c-interop/pr103390-1.f90

raw
1 ! { dg-do run }
2 ! { dg-options "-fdump-tree-original" }
3 !
4 ! This program used to ICE in gimplification on the call to S, because it
5 ! was trying to copy out the array after the call to something that wasn't
6 ! an lvalue.
7
8 program p
9 integer, pointer :: z(:)
10 integer, target :: x(3) = [1, 2, 3]
11 z => x
12 call s(shape(z))
13 contains
14 subroutine s(x) bind(c)
15 integer, contiguous :: x(:)
16 end
17 end
18
19 ! It should not emit any copy loops, just the loop for inlining SHAPE.
20 ! { dg-final { scan-tree-dump-times "while \\(1\\)" 1 "original" } }
21
22 ! It should not emit code to check the contiguous property.
23 ! { dg-final { scan-tree-dump-not "contiguous\\.\[0-9\]+" "original" } }