2 ! { dg-options "-fdump-tree-original" }
4 ! test for aliasing violations when converting class objects with
5 ! different target and pointer attributes.
17 subroutine do_it6 (par2_t
)
18 class (test
), target
:: par2_t
19 par2_t
%x
= par2_t
%x
+ 1
22 subroutine do_it5 (par1_p
)
23 class (test
), pointer, intent(in
) :: par1_p
25 ! { dg-final { scan-tree-dump "par2_t\[^\n]*VIEW_CONVERT_EXPR\[^\n]*par1_p" "original" } }
29 subroutine do_it4 (par_p
)
30 class (test
), pointer, intent(in
) :: par_p
32 ! { dg-final { scan-tree-dump-not "par1_p\[^\n]*VIEW_CONVERT_EXPR\[^\n]*par_p" "original" } }
36 subroutine do_it3 (par1_t
)
37 class (test
), target
:: par1_t
39 ! { dg-final { scan-tree-dump "par_p\[^\n]*VIEW_CONVERT_EXPR\[^\n]*par1_t" "original" } }
43 subroutine do_it2 (par_t
)
44 class (test
), target
:: par_t
46 ! { dg-final { scan-tree-dump-not "par1_t\[^\n]*VIEW_CONVERT_EXPR\[^\n]*par_t" "original" } }
50 subroutine do_it1 (par1_a
)
51 class (test
), allocatable
:: par1_a
52 ! allocatable -> target
53 ! { dg-final { scan-tree-dump "par_t\[^\n]*VIEW_CONVERT_EXPR\[^\n]*par1_a" "original" } }
57 subroutine do_it (par_a
)
58 class (test
), allocatable
:: par_a
59 ! allocatable -> allocatable
60 ! { dg-final { scan-tree-dump-not "par1_a\[^\n]*VIEW_CONVERT_EXPR\[^\n]*par_a" "original" } }
64 end module test_module
69 class (test
), allocatable
:: var_a
70 class (test
), pointer :: var_p
78 ! allocatable -> allocatable
79 ! { dg-final { scan-tree-dump-not "par_a\[^\n]*VIEW_CONVERT_EXPR\[^\n]*var_a" "original" } }
81 ! allocatable -> target
82 ! { dg-final { scan-tree-dump "par_t\[^\n]*VIEW_CONVERT_EXPR\[^\n]*var_a" "original" } }
85 ! { dg-final { scan-tree-dump "par_t\[^\n]*VIEW_CONVERT_EXPR\[^\n]*var_p" "original" } }
88 ! { dg-final { scan-tree-dump-not "par_p\[^\n]*VIEW_CONVERT_EXPR\[^\n]*var_p" "original" } }
90 if (var_a
%x
.ne
. 2) call abort()
91 if (var_p
%x
.ne
. 2) call abort()