brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 1bb2f7a Raw
35 lines · plain
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 %s4 5! Test that mod ref effects for variables captured in internal procedures6! propagate to all the variables they are in equivalence with.7subroutine test_captured_equiv()8  implicit none9  real :: test_var_x , test_var_y, test_var_z10  equivalence(test_var_x, test_var_y)11  call test_effect_internal()12contains13subroutine test_effect_internal()14  test_var_y = 0.15end subroutine16end subroutine17 18! CHECK-LABEL: Testing : "_QPtest_captured_equiv"19! CHECK: test_effect_internal -> test_var_x#0: ModRef20! CHECK: test_effect_internal -> test_var_y#0: ModRef21! CHECK: test_effect_internal -> test_var_z#0: NoModRef22 23subroutine test_no_capture()24  implicit none25  real :: test_var_x , test_var_y26  equivalence(test_var_x, test_var_y)27  call test_effect_internal()28contains29subroutine test_effect_internal()30end subroutine31end subroutine32! CHECK-LABEL: Testing : "_QPtest_no_capture"33! CHECK: test_effect_internal -> test_var_x#0: NoModRef34! CHECK: test_effect_internal -> test_var_y#0: NoModRef35