1 ! RUN: bbc -emit-hlfir %s -o - | %python %S/gen_mod_ref_test.py | \
2 ! RUN: fir-opt -pass-pipeline='builtin.module(func.func(test-fir-alias-analysis-modref))' \
3 ! RUN: --mlir-disable-threading -o /dev/null 2>&1 | FileCheck %s
5 ! Test that mod ref effects for variables captured in internal procedures
6 ! propagate to all the variables they are in equivalence with.
7 subroutine test_captured_equiv()
9 real :: test_var_x
, test_var_y
, test_var_z
10 equivalence(test_var_x
, test_var_y
)
11 call test_effect_internal()
13 subroutine test_effect_internal()
18 ! CHECK-LABEL: Testing : "_QPtest_captured_equiv"
19 ! CHECK: test_effect_internal -> test_var_x#0: ModRef
20 ! CHECK: test_effect_internal -> test_var_y#0: ModRef
21 ! CHECK: test_effect_internal -> test_var_z#0: NoModRef
23 subroutine test_no_capture()
25 real :: test_var_x
, test_var_y
26 equivalence(test_var_x
, test_var_y
)
27 call test_effect_internal()
29 subroutine test_effect_internal()
32 ! CHECK-LABEL: Testing : "_QPtest_no_capture"
33 ! CHECK: test_effect_internal -> test_var_x#0: NoModRef
34 ! CHECK: test_effect_internal -> test_var_y#0: NoModRef