-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][driver] Add extension options and -finput-charset
Add the following options: * -fimplicit-none and -fno-implicit-none * -fbackslash and -fno-backslash * -flogical-abbreviations and -fno-logical-abbreviations * -fxor-operator and -fno-xor-operator * -falternative-parameter-statement * -finput-charset=<value> Summary of changes: - Enable extensions in CompilerInvocation#ParseFrontendArgs - Add encoding_ to Fortran::frontend::FrontendOptions - Add encoding to Fortran::parser::Options Differential Revision: https://reviews.llvm.org/D96407
- Loading branch information
Faris Rehman
committed
Feb 16, 2021
1 parent
787d771
commit 10826ea
Showing
13 changed files
with
179 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
! Ensure argument -fbackslash works as expected. | ||
|
||
! REQUIRES: new-flang-driver | ||
|
||
!-------------------------- | ||
! FLANG DRIVER (flang-new) | ||
!-------------------------- | ||
! RUN: %flang-new -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED | ||
! RUN: %flang-new -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED | ||
! RUN: %flang-new -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED | ||
|
||
!----------------------------------------- | ||
! FRONTEND FLANG DRIVER (flang-new -fc1) | ||
!----------------------------------------- | ||
! RUN: %flang-new -fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED | ||
! RUN: %flang-new -fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED | ||
! RUN: %flang-new -fc1 -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED | ||
|
||
!----------------------------------------- | ||
! EXPECTED OUTPUT FOR ESCAPED BACKSLASHES | ||
!----------------------------------------- | ||
! ESCAPED:program backslash | ||
! ESCAPED-NEXT:New\\nline | ||
! ESCAPED-NOT:New\nline | ||
|
||
!------------------------------------------- | ||
! EXPECTED OUTPUT FOR UNESCAPED BACKSLASHES | ||
!------------------------------------------- | ||
! UNESCAPED:program backslash | ||
! UNESCAPED-NEXT:New\nline | ||
! UNESCAPED-NOT:New\\nline | ||
|
||
program Backslash | ||
print *, 'New\nline' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
! Test that flang-new forwards Flang frontend | ||
! options to flang-new -fc1 as expected. | ||
|
||
! REQUIRES: new-flang-driver | ||
|
||
! RUN: %flang-new -fsyntax-only -### %s -o %t 2>&1 \ | ||
! RUN: -finput-charset=utf-8 \ | ||
! RUN: | FileCheck %s | ||
|
||
! CHECK: "-finput-charset=utf-8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
! Ensure argument -fimplicit-none works as expected. | ||
|
||
! REQUIRES: new-flang-driver | ||
|
||
!-------------------------- | ||
! FLANG DRIVER (flang-new) | ||
!-------------------------- | ||
! RUN: %flang-new -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT | ||
! RUN: %flang-new -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT | ||
! RUN: not %flang-new -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE | ||
|
||
!----------------------------------------- | ||
! FRONTEND FLANG DRIVER (flang-new -fc1) | ||
!----------------------------------------- | ||
! RUN: %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT | ||
! RUN: %flang-new -fc1 -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT | ||
! RUN: not %flang-new -fc1 -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE | ||
|
||
!-------------------------------------- | ||
! EXPECTED OUTPUT FOR NO IMPLICIT NONE | ||
!-------------------------------------- | ||
! DEFAULT-NOT:error | ||
|
||
!------------------------------------------ | ||
! EXPECTED OUTPUT FOR IMPLICIT NONE ALWAYS | ||
!------------------------------------------ | ||
! WITH_IMPL_NONE:No explicit type declared for 'a' | ||
! WITH_IMPL_NONE:No explicit type declared for 'b' | ||
|
||
function a() | ||
a = b | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters