2 ! { dg-options "-fdump-tree-optimized -O3" }
3 ! Test setting host-/use-associated variables as VOLATILE
19 if (l
.neqv
. cmp
) call abort()
20 if (lv
.neqv
. cmp
) call abort()
23 if(l
.or
. lv
) print *, 'one_test1' ! not optimized away
27 if (l
.neqv
. cmp
) call abort()
28 if (lv
.neqv
. cmp
) call abort()
30 if(l
) print *, 'one_test2_1' ! optimized away
32 if(lv
) print *, 'one_test2_2' ! not optimized away
41 subroutine test1t(cmp
)
44 if (l
.neqv
. cmp
) call abort()
45 if (lv
.neqv
. cmp
) call abort()
47 if(l
) print *, 'two_test1_1' ! not optimized away
49 if(lv
) print *, 'two_test1_2' ! not optimized away
51 subroutine test2t(cmp
)
53 if (l
.neqv
. cmp
) call abort()
54 if (lv
.neqv
. cmp
) call abort()
56 if(l
) print *, 'two_test2_1' ! not optimized away
58 if(lv
) print *, 'two_test2_2' ! not optimized away
63 use :: two
, only
: test1t
, test2t
80 subroutine test1m(cmp
)
84 if(lm
.neqv
. cmp
) call abort()
85 if(lmv
.neqv
. cmp
) call abort()
94 if(lm
.or
. lmv
) print *, 'main_test1_1' ! not optimized away
96 if(l
) print *, 'main_test1_2' ! optimized away
98 if(lv
) print *, 'main_test1_3' ! not optimized away
105 end subroutine test1m
106 subroutine test2m(cmp
)
110 if(lm
.neqv
. cmp
) call abort
111 if(lmv
.neqv
. cmp
) call abort()
119 if(lm
) print *, 'main_test2_1' ! not optimized away
121 if(lmv
)print *, 'main_test2_2' ! not optimized away
123 if(l
) print *, 'main_test2_3' ! optimized away
125 if(lv
) print *, 'main_test2_4' ! not optimized away
132 end subroutine test2m
135 ! { dg-final { scan-tree-dump "one_test1" "optimized" } }
136 ! TODO: dg-final { scan-tree-dump-not "one_test2_1" "optimized" }
137 ! { dg-final { scan-tree-dump "one_test2_2" "optimized" } }
138 ! { dg-final { scan-tree-dump "one_test2_2" "optimized" } }
139 ! { dg-final { scan-tree-dump "two_test2_1" "optimized" } }
140 ! { dg-final { scan-tree-dump "two_test2_2" "optimized" } }
141 ! { dg-final { scan-tree-dump "main_test1_1" "optimized" } }
142 ! TODO: dg-final { scan-tree-dump-not "main_test1_2" "optimized" }
143 ! { dg-final { scan-tree-dump "main_test1_3" "optimized" } }
144 ! { dg-final { scan-tree-dump "main_test2_1" "optimized" } }
145 ! { dg-final { scan-tree-dump "main_test2_2" "optimized" } }
146 ! TODO: dg-final { scan-tree-dump-not "main_test2_3" "optimized" }
147 ! { dg-final { scan-tree-dump "main_test2_4" "optimized" } }