Skip to content

Commit 370e673

Browse files
committed
Update test and place it into Lower.
1 parent d016068 commit 370e673

File tree

3 files changed

+40
-34
lines changed

3 files changed

+40
-34
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
#if STEP == 1
3+
! these modules must be read from module files
4+
module generic_shadows_specific_m1
5+
interface f ! reference must be to generic
6+
module procedure f ! must have same name as generic interface
7+
end interface
8+
contains
9+
character function f() ! must be character
10+
f = 'q'
11+
end
12+
end
13+
module generic_shadows_specific_m2
14+
use generic_shadows_specific_m1
15+
end
16+
module generic_shadows_specific_m3
17+
use generic_shadows_specific_m2 ! must be generic_shadows_specific_m2, not generic_shadows_specific_m1
18+
contains
19+
subroutine mustExist() ! not called, but must exist
20+
character x
21+
x = f()
22+
end
23+
end
24+
25+
#else
26+
! Check that expected code produced with no crash.
27+
subroutine reproducer()
28+
use generic_shadows_specific_m2
29+
use generic_shadows_specific_m3
30+
character x
31+
x = f()
32+
end
33+
#endif
34+
35+
!RUN: rm -rf %t && mkdir -p %t
36+
!RUN: %flang_fc1 -fsyntax-only -DSTEP=1 -J%t %s
37+
!RUN: %flang_fc1 -emit-fir -J%t -o - %s | FileCheck %s
38+
39+
!CHECK-LABEL: func.func @_QPreproducer
40+
!CHECK: fir.call @_QMgeneric_shadows_specific_m1Pf

flang/test/Semantics/Inputs/generic-shadows-specific-a.f90

Lines changed: 0 additions & 21 deletions
This file was deleted.

flang/test/Semantics/generic-shadows-specific-b.f90

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)