Skip to content

Commit e643050

Browse files
authored
[flang] Complete alignment of -x language modes with gfortran (#133775)
1 parent 91df4cc commit e643050

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

clang/include/clang/Driver/Types.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ TYPE("assembler-with-cpp", Asm, PP_Asm, "S", phases
8888
// modules when Flang needs to emit pre-processed files. Therefore, the
8989
// `PP_TYPE` is set to `PP_Fortran` so that the driver is fine with
9090
// "pre-processing a pre-processed file".
91-
TYPE("f95", PP_Fortran, PP_Fortran, "i", phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
92-
TYPE("f95-cpp-input", Fortran, PP_Fortran, nullptr, phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
91+
TYPE("f95", Fortran, PP_Fortran, nullptr, phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
92+
TYPE("f95-cpp-input", PP_Fortran, PP_Fortran, "i", phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
9393
TYPE("java", Java, INVALID, nullptr, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
9494

9595
// LLVM IR/LTO types. We define separate types for IR and LTO because LTO

clang/test/Driver/fortran.f95

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
! RUN: | FileCheck --check-prefix=CHECK-OBJECT %s
66
! CHECK-OBJECT: gcc
77
! CHECK-OBJECT: "-c"
8-
! CHECK-OBJECT: "-x" "f95"
8+
! CHECK-OBJECT: "-x" "f95-cpp-input"
99
! CHECK-OBJECT-NOT: "-cc1as"
1010

1111
! RUN: %clang --target=x86_64-unknown-linux-gnu -integrated-as -S %s -### 2>&1 \
1212
! RUN: | FileCheck --check-prefix=CHECK-ASM %s
1313
! CHECK-ASM: gcc
1414
! CHECK-ASM: "-S"
15-
! CHECK-ASM: "-x" "f95"
15+
! CHECK-ASM: "-x" "f95-cpp-input"
1616
! CHECK-ASM-NOT: "-cc1"
1717

1818
! RUN: %clang -Wall --target=x86_64-unknown-linux-gnu -integrated-as %s -### 2>&1 | FileCheck --check-prefix=CHECK-WARN %s

flang/test/Driver/input-from-stdin/input-from-stdin.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
! Input type is implicit
77
! RUN: cat %s | %flang -E -cpp - | FileCheck %s --check-prefix=PP-NOT-DEFINED
88
! RUN: cat %s | %flang -DNEW -E -cpp - | FileCheck %s --check-prefix=PP-DEFINED
9-
! RUN: cat %s | %flang -DNEW -E - | FileCheck %s --check-prefix=PP-DEFINED
9+
! RUN: cat %s | %flang -DNEW -E - | FileCheck %s --check-prefix=PP-NOT-DEFINED
1010
! RUN: cat %s | %flang -DNEW -E -nocpp - | FileCheck %s --check-prefix=PP-NOT-DEFINED
1111

1212
! Input type is explicit

flang/test/Driver/phases.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
! RUN: %flang -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
55
! RUN: %flang -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
66

7-
! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
8-
! PP-NEXT: 1: preprocessor, {0}, f95
7+
! PP: +- 0: input, "{{.*}}phases.f90", f95
8+
! PP-NEXT: 1: preprocessor, {0}, f95-cpp-input
99

10-
! COMPILE: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
11-
! COMPILE-NEXT: 1: preprocessor, {0}, f95
10+
! COMPILE: +- 0: input, "{{.*}}phases.f90", f95
11+
! COMPILE-NEXT: 1: preprocessor, {0}, f95-cpp-input
1212
! COMPILE-NEXT: 2: compiler, {1}, none
1313

14-
! EMIT_OBJ: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
15-
! EMIT_OBJ-NEXT: 1: preprocessor, {0}, f95
14+
! EMIT_OBJ: +- 0: input, "{{.*}}phases.f90", f95
15+
! EMIT_OBJ-NEXT: 1: preprocessor, {0}, f95-cpp-input
1616
! EMIT_OBJ-NEXT: 2: compiler, {1}, ir
1717
! EMIT_OBJ-NEXT: +- 3: backend, {2}, assembler
1818
! EMIT_OBJ-NEXT: 4: assembler, {3}, object

flang/test/Driver/pp-fixed-form.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
!RUN: %flang -save-temps -### %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREE
2-
FREE: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/free-form-test.f90"
3-
FREE-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95" "free-form-test.i"
2+
FREE: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95" "{{.*}}/free-form-test.f90"
3+
FREE-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95-cpp-input" "free-form-test.i"
44

55
!RUN: %flang -save-temps -### %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXED
6-
FIXED: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/fixed-form-test.f"
7-
FIXED-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95" "fixed-form-test.i"
6+
FIXED: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95" "{{.*}}/fixed-form-test.f"
7+
FIXED-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95-cpp-input" "fixed-form-test.i"
88

99
!RUN: %flang -save-temps -### -ffree-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREE-FLAG
10-
FREE-FLAG: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/free-form-test.f90"
10+
FREE-FLAG: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95" "{{.*}}/free-form-test.f90"
1111
FREE-FLAG-NEXT: "-fc1" {{.*}} "-emit-llvm-bc" "-ffree-form"
1212
FREE-FLAG-NOT: "-ffixed-form"
13-
FREE-FLAG-SAME: "-x" "f95" "free-form-test.i"
13+
FREE-FLAG-SAME: "-x" "f95-cpp-input" "free-form-test.i"
1414

1515
!RUN: %flang -save-temps -### -ffixed-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXED-FLAG
16-
FIXED-FLAG: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/fixed-form-test.f"
16+
FIXED-FLAG: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95" "{{.*}}/fixed-form-test.f"
1717
FIXED-FLAG-NEXT: "-fc1" {{.*}} "-emit-llvm-bc" "-ffixed-form"
1818
FIXED-FLAG-NOT: "-ffixed-form"
19-
FIXED-FLAG-SAME: "-x" "f95" "fixed-form-test.i"
19+
FIXED-FLAG-SAME: "-x" "f95-cpp-input" "fixed-form-test.i"

0 commit comments

Comments
 (0)