File: boz_3.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (38 lines) | stat: -rw-r--r-- 1,437 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
! { dg-do run }
! { dg-options "-std=gnu -fallow-invalid-boz" }
!
! Test that the BOZ constant on the RHS, which are of different KIND than
! the LHS, are correctly converted.
!
program boz

   implicit none

   integer(1), parameter :: &
   &  b1 = b'000000000001111'                   ! { dg-warning "BOZ literal constant at" }
   integer(2), parameter :: &
   &  b2 = b'00000000000000000111000011110000'  ! { dg-warning "BOZ literal constant at" }
   integer(4), parameter :: &
   &  b4 = b'0000000000000000000000000000000001110000111100001111000011110000'  ! { dg-warning "BOZ literal constant at" }

   integer(1), parameter :: o1 = o'0012'              ! { dg-warning "BOZ literal constant at" }
   integer(2), parameter :: o2 = o'0004321'           ! { dg-warning "BOZ literal constant at" }
   integer(4), parameter :: o4 = o'0000000043210765'  ! { dg-warning "BOZ literal constant at" }

   integer(1), parameter :: z1 = z'0a'       ! { dg-warning "BOZ literal constant at" }
   integer(2), parameter :: z2 = z'00ab'     ! { dg-warning "BOZ literal constant at" }
   integer(4), parameter :: z4 = z'0000dead' ! { dg-warning "BOZ literal constant at" }

   if (b1 /= 15_1) STOP 1
   if (b2 /= 28912_2) STOP 2
   if (b4 /= 1894838512_4) STOP 3

   if (o1 /= 10_1) STOP 4
   if (o2 /= 2257_2) STOP 5
   if (o4 /= 9245173_4) STOP 6

   if (z1 /= 10_1) STOP 7
   if (z2 /= 171_2) STOP 8
   if (z4 /= 57005_4) STOP 9

end program boz