[flang] Complete alignment of -x language modes with gfortran (#133775)
This commit is contained in:
parent
91df4cce44
commit
e64305096a
@ -88,8 +88,8 @@ TYPE("assembler-with-cpp", Asm, PP_Asm, "S", phases
|
||||
// modules when Flang needs to emit pre-processed files. Therefore, the
|
||||
// `PP_TYPE` is set to `PP_Fortran` so that the driver is fine with
|
||||
// "pre-processing a pre-processed file".
|
||||
TYPE("f95", PP_Fortran, PP_Fortran, "i", phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
|
||||
TYPE("f95-cpp-input", Fortran, PP_Fortran, nullptr, phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
|
||||
TYPE("f95", Fortran, PP_Fortran, nullptr, phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
|
||||
TYPE("f95-cpp-input", PP_Fortran, PP_Fortran, "i", phases::Preprocess, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
|
||||
TYPE("java", Java, INVALID, nullptr, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
|
||||
|
||||
// LLVM IR/LTO types. We define separate types for IR and LTO because LTO
|
||||
|
@ -5,14 +5,14 @@
|
||||
! RUN: | FileCheck --check-prefix=CHECK-OBJECT %s
|
||||
! CHECK-OBJECT: gcc
|
||||
! CHECK-OBJECT: "-c"
|
||||
! CHECK-OBJECT: "-x" "f95"
|
||||
! CHECK-OBJECT: "-x" "f95-cpp-input"
|
||||
! CHECK-OBJECT-NOT: "-cc1as"
|
||||
|
||||
! RUN: %clang --target=x86_64-unknown-linux-gnu -integrated-as -S %s -### 2>&1 \
|
||||
! RUN: | FileCheck --check-prefix=CHECK-ASM %s
|
||||
! CHECK-ASM: gcc
|
||||
! CHECK-ASM: "-S"
|
||||
! CHECK-ASM: "-x" "f95"
|
||||
! CHECK-ASM: "-x" "f95-cpp-input"
|
||||
! CHECK-ASM-NOT: "-cc1"
|
||||
|
||||
! RUN: %clang -Wall --target=x86_64-unknown-linux-gnu -integrated-as %s -### 2>&1 | FileCheck --check-prefix=CHECK-WARN %s
|
||||
|
@ -6,7 +6,7 @@
|
||||
! Input type is implicit
|
||||
! RUN: cat %s | %flang -E -cpp - | FileCheck %s --check-prefix=PP-NOT-DEFINED
|
||||
! RUN: cat %s | %flang -DNEW -E -cpp - | FileCheck %s --check-prefix=PP-DEFINED
|
||||
! RUN: cat %s | %flang -DNEW -E - | FileCheck %s --check-prefix=PP-DEFINED
|
||||
! RUN: cat %s | %flang -DNEW -E - | FileCheck %s --check-prefix=PP-NOT-DEFINED
|
||||
! RUN: cat %s | %flang -DNEW -E -nocpp - | FileCheck %s --check-prefix=PP-NOT-DEFINED
|
||||
|
||||
! Input type is explicit
|
||||
|
@ -4,15 +4,15 @@
|
||||
! RUN: %flang -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
|
||||
! RUN: %flang -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
|
||||
|
||||
! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
|
||||
! PP-NEXT: 1: preprocessor, {0}, f95
|
||||
! PP: +- 0: input, "{{.*}}phases.f90", f95
|
||||
! PP-NEXT: 1: preprocessor, {0}, f95-cpp-input
|
||||
|
||||
! COMPILE: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
|
||||
! COMPILE-NEXT: 1: preprocessor, {0}, f95
|
||||
! COMPILE: +- 0: input, "{{.*}}phases.f90", f95
|
||||
! COMPILE-NEXT: 1: preprocessor, {0}, f95-cpp-input
|
||||
! COMPILE-NEXT: 2: compiler, {1}, none
|
||||
|
||||
! EMIT_OBJ: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
|
||||
! EMIT_OBJ-NEXT: 1: preprocessor, {0}, f95
|
||||
! EMIT_OBJ: +- 0: input, "{{.*}}phases.f90", f95
|
||||
! EMIT_OBJ-NEXT: 1: preprocessor, {0}, f95-cpp-input
|
||||
! EMIT_OBJ-NEXT: 2: compiler, {1}, ir
|
||||
! EMIT_OBJ-NEXT: +- 3: backend, {2}, assembler
|
||||
! EMIT_OBJ-NEXT: 4: assembler, {3}, object
|
||||
|
@ -1,19 +1,19 @@
|
||||
!RUN: %flang -save-temps -### %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREE
|
||||
FREE: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/free-form-test.f90"
|
||||
FREE-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95" "free-form-test.i"
|
||||
FREE: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95" "{{.*}}/free-form-test.f90"
|
||||
FREE-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95-cpp-input" "free-form-test.i"
|
||||
|
||||
!RUN: %flang -save-temps -### %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXED
|
||||
FIXED: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/fixed-form-test.f"
|
||||
FIXED-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95" "fixed-form-test.i"
|
||||
FIXED: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95" "{{.*}}/fixed-form-test.f"
|
||||
FIXED-NEXT: "-fc1" {{.*}} "-ffixed-form" {{.*}} "-x" "f95-cpp-input" "fixed-form-test.i"
|
||||
|
||||
!RUN: %flang -save-temps -### -ffree-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREE-FLAG
|
||||
FREE-FLAG: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/free-form-test.f90"
|
||||
FREE-FLAG: "-fc1" {{.*}} "-o" "free-form-test.i" {{.*}} "-x" "f95" "{{.*}}/free-form-test.f90"
|
||||
FREE-FLAG-NEXT: "-fc1" {{.*}} "-emit-llvm-bc" "-ffree-form"
|
||||
FREE-FLAG-NOT: "-ffixed-form"
|
||||
FREE-FLAG-SAME: "-x" "f95" "free-form-test.i"
|
||||
FREE-FLAG-SAME: "-x" "f95-cpp-input" "free-form-test.i"
|
||||
|
||||
!RUN: %flang -save-temps -### -ffixed-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXED-FLAG
|
||||
FIXED-FLAG: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95-cpp-input" "{{.*}}/fixed-form-test.f"
|
||||
FIXED-FLAG: "-fc1" {{.*}} "-o" "fixed-form-test.i" {{.*}} "-x" "f95" "{{.*}}/fixed-form-test.f"
|
||||
FIXED-FLAG-NEXT: "-fc1" {{.*}} "-emit-llvm-bc" "-ffixed-form"
|
||||
FIXED-FLAG-NOT: "-ffixed-form"
|
||||
FIXED-FLAG-SAME: "-x" "f95" "fixed-form-test.i"
|
||||
FIXED-FLAG-SAME: "-x" "f95-cpp-input" "fixed-form-test.i"
|
||||
|
Loading…
x
Reference in New Issue
Block a user