SCEV: thread samesign in isBasicBlockEntryGuardedByCond (NFC) (#125840)
[llvm-project.git] / flang / test / Analysis / AliasAnalysis / modref-call-equivalence.f90
blob1bb2f7a66431f8689d706f22a450e0c6d653a9a3
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()
8 implicit none
9 real :: test_var_x , test_var_y, test_var_z
10 equivalence(test_var_x, test_var_y)
11 call test_effect_internal()
12 contains
13 subroutine test_effect_internal()
14 test_var_y = 0.
15 end subroutine
16 end subroutine
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()
24 implicit none
25 real :: test_var_x , test_var_y
26 equivalence(test_var_x, test_var_y)
27 call test_effect_internal()
28 contains
29 subroutine test_effect_internal()
30 end subroutine
31 end subroutine
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