Skip to content

Commit 04f52d6

Browse files
committed
Add test
The test compiles and links a short program that uses the three kind arrays. It is supposed to fail and link time if the symbols are not provided in the runtime.
1 parent 268aca4 commit 04f52d6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
!RUN: %flang -o %t %s
2+
3+
program kind_array_symbols
4+
use iso_fortran_env, only: integer_kinds, real_kinds, logical_kinds
5+
implicit none
6+
7+
integer :: i
8+
i = 1
9+
10+
! accesses via a variable array index cause code-gen
11+
! to emit used symbols in the object code
12+
print *, integer_kinds(i)
13+
print *, real_kinds(i)
14+
print *, logical_kinds(i)
15+
end program kind_array_symbols

0 commit comments

Comments
 (0)