Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/power_5.f90 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 (2017-10-27) |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do run } | |
2 ! { dg-options "-ffrontend-optimize -fdump-tree-original" } | |
3 ! PR 57071 - Check that 1**k is transformed into 1 | |
4 program main | |
5 implicit none | |
6 integer, parameter :: n = 3 | |
7 integer(kind=8), dimension(-n:n) :: a | |
8 integer, dimension(-n:n) :: c, d | |
9 integer :: m | |
10 integer :: i, v | |
11 integer (kind=2) :: i2 | |
12 | |
13 v = 1 | |
14 m = n | |
15 ! Test in scalar expressions | |
16 do i=-n,n | |
17 if (v /= 1**i) call abort | |
18 end do | |
19 | |
20 ! Test in array constructors | |
21 a(-m:m) = [ (1**i, i= -m, m) ] | |
22 if (any(a .ne. v)) call abort | |
23 | |
24 ! Test in array expressions | |
25 c = [ ( i, i = -n , n ) ] | |
26 d = 1**c | |
27 if (any(d .ne. v)) call abort | |
28 | |
29 ! Test in different kind expressions | |
30 do i2=-n,n | |
31 if (v /= 1**i2) call abort | |
32 end do | |
33 | |
34 end program main | |
35 ! { dg-final { scan-tree-dump-times "_gfortran_pow_i4_i4" 0 "original" } } |