Skip to content

Commit 3e5f80c

Browse files
committed
Add LOWER= to semantics test
1 parent aaa6fbb commit 3e5f80c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

flang/test/Semantics/c_f_pointer.f90

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,12 @@ program test
5454
call c_f_pointer(scalarC, c2ptr)
5555
!WARNING: FPTR= argument to C_F_POINTER() should not have the non-interoperable intrinsic type or kind CHARACTER(KIND=4,LEN=1_8) [-Winteroperability]
5656
call c_f_pointer(scalarC, unicodePtr)
57+
58+
!ERROR: SHAPE= argument to C_F_POINTER() may not appear when FPTR= is scalar
59+
!ERROR: LOWER= argument to C_F_POINTER() may not appear when FPTR= is scalar
60+
call c_f_pointer(scalarC, scalarIntF, [1_8], [0_8])
61+
!ERROR: LOWER= argument to C_F_POINTER() must be a rank-one array.
62+
call c_f_pointer(scalarC, arrayIntF, shape=[1_8], lower=rankTwoArray)
63+
!ERROR: SHAPE= argument to C_F_POINTER() must appear when FPTR= is an array
64+
call c_f_pointer(scalarC, arrayIntF, lower=[0])
5765
end program

0 commit comments

Comments
 (0)