1 ! Ensure argument -fdefault* work as expected.
2 ! TODO: Add checks when actual codegen is possible for this family
4 !--------------------------
5 ! FLANG DRIVER (flang-new)
6 !--------------------------
7 ! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1
8 ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION
9 ! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1
10 ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8
11 ! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1
12 ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8
13 ! RUN: not %flang -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR
15 !-----------------------------------------
16 ! FRONTEND FLANG DRIVER (flang-new -fc1)
17 !-----------------------------------------
18 ! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1
19 ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION
20 ! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1
21 ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8
22 ! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1
23 ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8
24 ! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR
26 ! NOOPTION: integer(4),parameter::real_kind=4_4
27 ! NOOPTION-NEXT: intrinsic::kind
28 ! NOOPTION-NEXT: integer(4),parameter::double_kind=8_4
30 ! REAL8: integer(4),parameter::real_kind=8_4
31 ! REAL8-NEXT: intrinsic::kind
32 ! REAL8-NEXT: integer(4),parameter::double_kind=16_4
34 ! DOUBLE8: integer(4),parameter::real_kind=8_4
35 ! DOUBLE8-NEXT: intrinsic::kind
36 ! DOUBLE8-NEXT: integer(4),parameter::double_kind=8_4
38 ! ERROR: Use of `-fdefault-double-8` requires `-fdefault-real-8`
44 integer, parameter :: real_kind
= kind(x
) !-fdefault-real-8
45 integer, parameter :: double_kind
= kind(y
) !-fdefault-double-8