[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / power_4.f90
blob3b2688c77b8ddfe774b818a510071b390b778e0b
1 ! { dg-do run }
2 ! { dg-options "-ffrontend-optimize -fdump-tree-original" }
3 ! PR 57071 - Check that 2**k is transformed into ishift(1,k).
4 program main
5 implicit none
6 integer :: i,m,v
7 integer, parameter :: n=30
8 integer, dimension(-n:n) :: a,b,c,d,e
9 m = n
11 v = 2
12 ! Test scalar expressions.
13 do i=-n,n
14 if (2**i /= v**i) call abort
15 end do
17 ! Test array constructors
18 b = [(2**i,i=-m,m)]
19 c = [(v**i,i=-m,m)]
20 if (any(b /= c)) call abort
22 ! Test array expressions
23 a = [(i,i=-m,m)]
24 d = 2**a
25 e = v**a
26 if (any(d /= e)) call abort
27 end program main
28 ! { dg-final { scan-tree-dump-times "_gfortran_pow_i4_i4" 3 "original" } }