OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [integer_exponentiation_4.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "" }
3
program test
4
  implicit none
5
 
6
!!!!!! INTEGER BASE !!!!!!
7
  print *, 0**0
8
  print *, 0**1
9
  print *, 0**(-1) ! { dg-error "Division by zero" }
10
  print *, 0**(huge(0))
11
  print *, 0**(-huge(0)-1) ! { dg-error "Division by zero" }
12
  print *, 0**(2_8**32)
13
  print *, 0**(-(2_8**32)) ! { dg-error "Division by zero" }
14
 
15
  print *, 1**huge(0)
16
  print *, 1**(-huge(0)-1)
17
  print *, 1**huge(0_8)
18
  print *, 1**(-huge(0_8)-1_8)
19
  print *, (-1)**huge(0)
20
  print *, (-1)**(-huge(0)-1)
21
  print *, (-1)**huge(0_8)
22
  print *, (-1)**(-huge(0_8)-1_8)
23
 
24
  print *, 2**huge(0) ! { dg-error "Arithmetic overflow" }
25
  print *, 2**huge(0_8) ! { dg-error "Arithmetic overflow" }
26
  print *, (-2)**huge(0) ! { dg-error "Arithmetic overflow" }
27
  print *, (-2)**huge(0_8) ! { dg-error "Arithmetic overflow" }
28
 
29
  print *, 2**(-huge(0)-1)
30
  print *, 2**(-huge(0_8)-1_8)
31
  print *, (-2)**(-huge(0)-1)
32
  print *, (-2)**(-huge(0_8)-1_8)
33
 
34
!!!!!! REAL BASE !!!!!!
35
  print *, 0.0**(-1) ! { dg-error "Arithmetic overflow" }
36
  print *, 0.0**(-huge(0)-1) ! { dg-error "Arithmetic overflow" }
37
  print *, 2.0**huge(0) ! { dg-error "Arithmetic overflow" }
38
  print *, nearest(1.0,-1.0)**(-huge(0)) ! { dg-error "Arithmetic overflow" }
39
 
40
!!!!!! COMPLEX BASE !!!!!!
41
  print *, (2.0,-4.3)**huge(0) ! { dg-error "Arithmetic overflow" }
42
  print *, (2.0,-4.3)**huge(0_8) ! { dg-error "Arithmetic overflow" }
43
  print *, (2.0,-4.3)**(-huge(0))
44
  print *, (2.0,-4.3)**(-huge(0_8))
45
 
46
end program test

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.