Skip to content

Commit 54aeca8

Browse files
committed
add test
1 parent 58219f2 commit 54aeca8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
!RUN: %flang_fc1 -cpp -DFILE1 -DFILE2 %s | FileCheck %s --allow-empty
2+
!RUN: %flang_fc1 -cpp -DFILE1 %s | FileCheck %s --allow-empty
3+
!RUN: %flang_fc1 -cpp -DFILE2 %s | FileCheck %s --allow-empty
4+
5+
!CHECK-NOT: error
6+
!CHECK-NOT: warning
7+
8+
#ifdef FILE1
9+
module m
10+
implicit none
11+
private
12+
public :: f1
13+
interface f1
14+
pure module function f1(n) result(res)
15+
integer, intent(in) :: n
16+
integer :: res(max(n, 0))
17+
end function f1
18+
end interface f1
19+
end module m
20+
#endif
21+
22+
#ifdef FILE2
23+
submodule (m) sm
24+
implicit none
25+
contains
26+
pure module function f1(n) result(res)
27+
integer, intent(in) :: n
28+
integer :: res(max(n, 0))
29+
res(:) = 0
30+
end function f1
31+
end submodule sm
32+
#endif

0 commit comments

Comments
 (0)