xref: /llvm-project/flang/test/Semantics/kinds04_q16.f90 (revision e306db0ff0d348da49b44bd0bcae3df5bf8f02a9)
1! RUN: not %flang_fc1 %s 2>%t.stderr
2! RUN: FileCheck %s --input-file=%t.stderr --check-prefixes=%if system-aix %{"PORTABILITY","WARNING","ERROR","AIX_WARNING"%} %else %{"PORTABILITY","WARNING","ERROR"%}
3! C716 If both kind-param and exponent-letter appear, exponent-letter
4! shall be E. (As an extension we also allow an exponent-letter which matches
5! the kind-param)
6! C717 The value of kind-param shall specify an approximation method that
7! exists on the processor.
8!
9! This test is for non-x86_64, where exponent-letter 'q' is for
10! 16-byte quadruple precision
11! UNSUPPORTED: x86-registered-target
12subroutine s(var)
13  real :: realvar1 = 4.0E6_4
14  real :: realvar2 = 4.0D6
15  real :: realvar3 = 4.0Q6
16  !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
17  real :: realvar4 = 4.0D6_8
18  !WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
19  !AIX_WARNING: underflow on REAL(10) to REAL(4) conversion
20  real :: realvar5 = 4.0Q6_10
21  !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
22  real :: realvar6 = 4.0Q6_16
23  real :: realvar7 = 4.0E6_8
24  !AIX_WARNING: underflow on REAL(10) to REAL(4) conversion
25  real :: realvar8 = 4.0E6_10
26  real :: realvar9 = 4.0E6_16
27  !ERROR: Unsupported REAL(KIND=32)
28  real :: realvar10 = 4.0E6_32
29
30  double precision :: doublevar1 = 4.0E6_4
31  double precision :: doublevar2 = 4.0D6
32  double precision :: doublevar3 = 4.0Q6
33  !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
34  double precision :: doublevar4 = 4.0D6_8
35  !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
36  double precision :: doublevar5 = 4.0Q6_16
37  double precision :: doublevar6 = 4.0E6_8
38  !AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
39  double precision :: doublevar7 = 4.0E6_10
40  double precision :: doublevar8 = 4.0E6_16
41  !ERROR: Unsupported REAL(KIND=32)
42  double precision :: doublevar9 = 4.0E6_32
43end subroutine s
44