1 ! Ensure argument -ffixed-line-length=n works as expected.
3 !--------------------------
5 !--------------------------
6 ! RUN: %flang -E -Xflang -fno-reformat %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=DEFAULTLENGTH
7 ! RUN: not %flang -E -Xflang -fno-reformat -ffixed-line-length=-2 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGATIVELENGTH
8 ! RUN: not %flang -E -Xflang -fno-reformat -ffixed-line-length=3 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INVALIDLENGTH
9 ! RUN: %flang -E -Xflang -fno-reformat -ffixed-line-length=none %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
10 ! RUN: %flang -E -Xflang -fno-reformat -ffixed-line-length=0 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
11 ! RUN: %flang -E -Xflang -fno-reformat -ffixed-line-length=13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
13 !----------------------------------------
14 ! FRONTEND FLANG DRIVER (flang -fc1)
15 !----------------------------------------
16 ! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=DEFAULTLENGTH
17 ! RUN: not %flang_fc1 -E -fno-reformat -ffixed-line-length=-2 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGATIVELENGTH
18 ! RUN: not %flang_fc1 -E -fno-reformat -ffixed-line-length=3 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INVALIDLENGTH
19 ! RUN: %flang_fc1 -E -fno-reformat -ffixed-line-length=none %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
20 ! RUN: %flang_fc1 -E -fno-reformat -ffixed-line-length=0 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
21 ! RUN: %flang_fc1 -E -fno-reformat -ffixed-line-length=13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
23 !-------------------------------------
24 ! COMMAND ALIAS -ffixed-line-length-n
25 !-------------------------------------
26 ! RUN: %flang -E -Xflang -fno-reformat -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
27 ! RUN: %flang_fc1 -E -fno-reformat -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
29 !-------------------------------------
30 ! EXPECTED OUTPUT WITH DEFAULT LENGTH
31 !-------------------------------------
32 ! The line should be trimmed to 72 characters when reading based on the default value of fixed line length.
33 ! DEFAULTLENGTH: program{{(a{58})}}
35 !-----------------------------------------
36 ! EXPECTED OUTPUT WITH A NEGATIVE LENGTH
37 !-----------------------------------------
38 ! NEGATIVELENGTH: invalid value '-2' in 'ffixed-line-length=', value must be 'none' or a positive integer
40 !-----------------------------------------
41 ! EXPECTED OUTPUT WITH LENGTH LESS THAN 7
42 !-----------------------------------------
43 ! INVALIDLENGTH: invalid value '3' in 'ffixed-line-length=', value must be '7' or greater
45 !---------------------------------------
46 ! EXPECTED OUTPUT WITH UNLIMITED LENGTH
47 !---------------------------------------
48 ! The line should not be trimmed and so 73 characters (including spaces) should be read.
49 ! UNLIMITEDLENGTH: program{{(a{59})}}
51 !--------------------------------
52 ! EXPECTED OUTPUT WITH LENGTH 13
53 !--------------------------------