diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -615,8 +615,8 @@ Flags<[NoXarchOption, HelpHidden]>; def driver_mode : Joined<["--"], "driver-mode=">, Group, Flags<[NoXarchOption, HelpHidden]>, - Visibility<[ClangOption, CLOption, DXCOption]>, - HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', or 'cl'">; + Visibility<[ClangOption, FlangOption, CLOption, DXCOption]>, + HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', 'cl' or 'flang'">; def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group, Flags<[NoXarchOption, HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption]>, @@ -630,7 +630,9 @@ Visibility<[ClangOption, CLOption, DXCOption]>; def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt, HelpText<"Simulate installation in the given directory">; -def ccc_print_phases : Flag<["-"], "ccc-print-phases">, InternalDebugOpt, +def ccc_print_phases : Flag<["-"], "ccc-print-phases">, + Flags<[NoXarchOption, HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption, + FlangOption]>, HelpText<"Dump list of actions to perform">; def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, InternalDebugOpt, HelpText<"Show bindings of tools to actions">; @@ -849,15 +851,15 @@ Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">; def Mach : Flag<["-"], "Mach">, Group; def O0 : Flag<["-"], "O0">, Group, Flags<[HelpHidden]>, - Visibility<[ClangOption, CC1Option, FC1Option]>; + Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>; def O4 : Flag<["-"], "O4">, Group, Flags<[HelpHidden]>, - Visibility<[ClangOption, CC1Option, FC1Option]>; + Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>; def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C++ inputs">; def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C inputs">; def O : Joined<["-"], "O">, Group, - Visibility<[ClangOption, CC1Option, FC1Option]>; + Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>; def O_flag : Flag<["-"], "O">, Visibility<[ClangOption, CC1Option, FC1Option]>, Alias, AliasArgs<["1"]>; def Ofast : Joined<["-"], "Ofast">, Group, @@ -893,7 +895,7 @@ HelpText<"Pass the comma separated arguments in to the assembler">, MetaVarName<"">; def Wall : Flag<["-"], "Wall">, Group, Flags<[HelpHidden]>, - Visibility<[ClangOption, CC1Option]>; + Visibility<[ClangOption, CC1Option, FlangOption]>; def WCL4 : Flag<["-"], "WCL4">, Group, Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>; def Wsystem_headers : Flag<["-"], "Wsystem-headers">, Group, @@ -1095,12 +1097,14 @@ // Common offloading options let Group = offload_Group in { def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>, + Visibility<[ClangOption, FlangOption]>, HelpText<"Specify an offloading device architecture for CUDA, HIP, or OpenMP. (e.g. sm_35). " "If 'native' is used the compiler will detect locally installed architectures. " "For HIP offloading, the device architecture can be followed by target ID features " "delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once.">; def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">, Flags<[NoXarchOption]>, + Visibility<[ClangOption, FlangOption]>, HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. " "'all' resets the list to its default value.">; @@ -1999,7 +2003,7 @@ PosFlag, - NegFlag>; + NegFlag>; defm math_errno : BoolFOption<"math-errno", LangOpts<"MathErrno">, DefaultFalse, PosFlag; def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">, Group; -def fassociative_math : Flag<["-"], "fassociative-math">, Group; -def fno_associative_math : Flag<["-"], "fno-associative-math">, Group; +def fassociative_math : Flag<["-"], "fassociative-math">, Visibility<[ClangOption, FlangOption]>, Group; +def fno_associative_math : Flag<["-"], "fno-associative-math">, Visibility<[ClangOption, FlangOption]>, Group; defm reciprocal_math : BoolFOption<"reciprocal-math", LangOpts<"AllowRecip">, DefaultFalse, PosFlag, PosFlag>; def fhonor_nans : Flag<["-"], "fhonor-nans">, Group, + Visibility<[ClangOption, FlangOption]>, HelpText<"Specify that floating-point optimizations are not allowed that " "assume arguments and results are not NANs.">; -def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Group; +def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Visibility<[ClangOption, FlangOption]>, Group; def fhonor_infinities : Flag<["-"], "fhonor-infinities">, - Group, + Group, Visibility<[ClangOption, FlangOption]>, HelpText<"Specify that floating-point optimizations are not allowed that " "assume arguments and results are not +-inf.">; -def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, Group; +def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, + Visibility<[ClangOption, FlangOption]>, Group; // This option was originally misspelt "infinites" [sic]. def : Flag<["-"], "fhonor-infinites">, Alias; def : Flag<["-"], "fno-honor-infinites">, Alias; @@ -2682,9 +2688,9 @@ Visibility<[ClangOption, CLOption, CC1Option, FC1Option, FlangOption]>, Group, HelpText<"Set LTO mode">, Values<"thin,full">; -def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Group, +def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Visibility<[ClangOption, FlangOption]>, Group, Alias, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">; -def flto_EQ_auto : Flag<["-"], "flto=auto">, Group, +def flto_EQ_auto : Flag<["-"], "flto=auto">, Visibility<[ClangOption, FlangOption]>, Group, Alias, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">; def flto : Flag<["-"], "flto">, Visibility<[ClangOption, CLOption, CC1Option, FC1Option, FlangOption]>, @@ -2696,7 +2702,7 @@ NegFlag, BothFlags<[], [ClangOption, CC1Option], "">>; def fno_lto : Flag<["-"], "fno-lto">, - Visibility<[ClangOption, CLOption, CC1Option]>, Group, + Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FlangOption]>, Group, HelpText<"Disable LTO mode (default)">; def foffload_lto_EQ : Joined<["-"], "foffload-lto=">, Visibility<[ClangOption, CLOption]>, Group, @@ -3207,7 +3213,7 @@ def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group, Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>; def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">, - Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>, + Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option, FlangOption]>, HelpText<"Specify comma-separated list of triples OpenMP offloading targets to be supported">; def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">, Group, Flags<[NoArgumentUnused, HelpHidden]>, @@ -3239,7 +3245,7 @@ //===----------------------------------------------------------------------===// let Flags = [NoArgumentUnused] in { -let Visibility = [ClangOption, CC1Option, FC1Option] in { +let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption] in { let Group = f_Group in { def fopenmp_target_debug : Flag<["-"], "fopenmp-target-debug">, @@ -3272,7 +3278,7 @@ } // let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption] let Flags = [NoArgumentUnused, HelpHidden] in { -let Visibility = [ClangOption, CC1Option, FC1Option] in { +let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption] in { let Group = f_Group in { def fopenmp_target_debug_EQ : Joined<["-"], "fopenmp-target-debug=">; @@ -3363,8 +3369,8 @@ def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group; def fpic : Flag<["-"], "fpic">, Group; def fno_pic : Flag<["-"], "fno-pic">, Group; -def fpie : Flag<["-"], "fpie">, Group; -def fno_pie : Flag<["-"], "fno-pie">, Group; +def fpie : Flag<["-"], "fpie">, Visibility<[ClangOption, FlangOption]>, Group; +def fno_pie : Flag<["-"], "fno-pie">, Visibility<[ClangOption, FlangOption]>, Group; defm pic_data_is_text_relative : SimpleMFlag<"pic-data-is-text-relative", "Assume", "Don't assume", " data segments are relative to text segment">; def fdirect_access_external_data : Flag<["-"], "fdirect-access-external-data">, Group, @@ -3928,13 +3934,13 @@ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, HelpText<"Emit debug line number tables only">; def gline_directives_only : Flag<["-"], "gline-directives-only">, Group, - Visibility<[ClangOption, CLOption, DXCOption]>, + Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, HelpText<"Emit debug line info directives only">; def gmlt : Flag<["-"], "gmlt">, Alias; -def g0 : Flag<["-"], "g0">, Group; -def g1 : Flag<["-"], "g1">, Group, Alias; -def g2 : Flag<["-"], "g2">, Group; -def g3 : Flag<["-"], "g3">, Group; +def g0 : Flag<["-"], "g0">, Group, Visibility<[ClangOption, FlangOption]>; +def g1 : Flag<["-"], "g1">, Group, Visibility<[ClangOption, FlangOption]>, Alias; +def g2 : Flag<["-"], "g2">, Group, Visibility<[ClangOption, FlangOption]>; +def g3 : Flag<["-"], "g3">, Group, Visibility<[ClangOption, FlangOption]>; def ggdb : Flag<["-"], "ggdb">, Group; def ggdb0 : Flag<["-"], "ggdb0">, Group; def ggdb1 : Flag<["-"], "ggdb1">, Group; @@ -4217,7 +4223,7 @@ def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias; } // let Flags = [TargetSpecific] def march_EQ : Joined<["-"], "march=">, Group, - Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption]>, + Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, HelpText<"For a list of available architectures for the target use '-mcpu=help'">; def masm_EQ : Joined<["-"], "masm=">, Group, Flags<[NoXarchOption]>; def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group, @@ -4246,8 +4252,6 @@ def mguard_EQ : Joined<["-"], "mguard=">, Group, HelpText<"Enable or disable Control Flow Guard checks and guard tables emission">, Values<"none,cf,cf-nochecks">; -def mcpu_EQ : Joined<["-"], "mcpu=">, Group, - HelpText<"For a list of available CPUs for the target use '-mcpu=help'">; def mmcu_EQ : Joined<["-"], "mmcu=">, Group; def msim : Flag<["-"], "msim">, Group; def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group; @@ -5032,8 +5036,8 @@ def nofixprebinding : Flag<["-"], "nofixprebinding">; def nolibc : Flag<["-"], "nolibc">; def nomultidefs : Flag<["-"], "nomultidefs">; -def nopie : Flag<["-"], "nopie">; -def no_pie : Flag<["-"], "no-pie">, Alias; +def nopie : Flag<["-"], "nopie">, Visibility<[ClangOption, FlangOption]>; +def no_pie : Flag<["-"], "no-pie">, Visibility<[ClangOption, FlangOption]>, Alias; def noprebind : Flag<["-"], "noprebind">; def noprofilelib : Flag<["-"], "noprofilelib">; def noseglinkedit : Flag<["-"], "noseglinkedit">; @@ -5392,8 +5396,6 @@ def _for_linker : Separate<["--"], "for-linker">, Alias; def _force_link_EQ : Joined<["--"], "force-link=">, Alias; def _force_link : Separate<["--"], "force-link">, Alias; -def _help_hidden : Flag<["--"], "help-hidden">, - HelpText<"Display help for hidden options">; def _imacros_EQ : Joined<["--"], "imacros=">, Alias; def _include_barrier : Flag<["--"], "include-barrier">, Alias; def _include_directory_after_EQ : Joined<["--"], "include-directory-after=">, Alias; @@ -5449,8 +5451,6 @@ def _signed_char : Flag<["--"], "signed-char">, Alias; def _std : Separate<["--"], "std">, Alias; def _stdlib : Separate<["--"], "stdlib">, Alias; -def _sysroot_EQ : Joined<["--"], "sysroot=">; -def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; def _target_help : Flag<["--"], "target-help">; def _trace_includes : Flag<["--"], "trace-includes">, Alias; def _undefine_macro_EQ : Joined<["--"], "undefine-macro=">, Alias; @@ -5463,6 +5463,24 @@ def _write_dependencies : Flag<["--"], "write-dependencies">, Alias; def _write_user_dependencies : Flag<["--"], "write-user-dependencies">, Alias; +def _help_hidden : Flag<["--"], "help-hidden">, + Visibility<[ClangOption, FlangOption]>, + HelpText<"Display help for hidden options">; +def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOption]>; +def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; + +//===----------------------------------------------------------------------===// +// Target Options (clang + flang-new) +//===----------------------------------------------------------------------===// +let Flags = [TargetSpecific] in { +let Visibility = [ClangOption, FlangOption] in { + +def mcpu_EQ : Joined<["-"], "mcpu=">, Group, + HelpText<"For a list of available CPUs for the target use '-mcpu=help'">; + +} // let Vis = [Default, FlangOption] +} // let Flags = [TargetSpecific] + // Hexagon feature flags. let Flags = [TargetSpecific] in { def mieee_rnd_near : Flag<["-"], "mieee-rnd-near">, @@ -5810,7 +5828,7 @@ // style of double-dash and equals-joined flags. def target_legacy_spelling : Separate<["-"], "target">, Alias, - Visibility<[ClangOption, CLOption, DXCOption]>; + Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>; // Special internal option to handle -Xlinker --no-demangle. def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">, @@ -5835,7 +5853,8 @@ } multiclass FlangIgnoredDiagOpt { - def unsupported_warning_w#NAME : Flag<["-", "--"], "W"#name>, Group; + def unsupported_warning_w#NAME : Flag<["-", "--"], "W"#name>, + Visibility<[FlangOption]>, Group; } defm : BooleanFFlag<"keep-inline-functions">, Group; diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -6495,9 +6495,7 @@ if (IsDXCMode()) return llvm::opt::Visibility(options::DXCOption); if (IsFlangMode()) { - // TODO: Does flang really want *all* of the clang driver options? - // We probably need to annotate more specifically. - return llvm::opt::Visibility(options::ClangOption | options::FlangOption); + return llvm::opt::Visibility(options::FlangOption); } return llvm::opt::Visibility(options::ClangOption); } diff --git a/clang/test/Driver/flang/flang.f90 b/clang/test/Driver/flang/flang.f90 --- a/clang/test/Driver/flang/flang.f90 +++ b/clang/test/Driver/flang/flang.f90 @@ -22,10 +22,6 @@ ! CHECK-E-DAG: "-E" ! CHECK-E-DAG: "-o" "-" -! RUN: %clang --driver-mode=flang -### -emit-ast %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-AST %s -! CHECK-EMIT-AST-DAG: "-emit-ast" -! CHECK-EMIT-AST-DAG: "-o" "{{[^"]*}}.ast" - ! RUN: %clang --driver-mode=flang -### -fsyntax-only %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-SYNTAX-ONLY %s ! CHECK-SYNTAX-ONLY-NOT: "-o" ! CHECK-SYNTAX-ONLY-DAG: "-fsyntax-only" @@ -42,7 +38,7 @@ ! CHECK-S-DAG: "-S" ! CHECK-S-DAG: "-o" "{{[^"]*}}.s" -! RUN: %clang --driver-mode=flang -### -fintegrated-as %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-OBJ %s +! RUN: %clang --driver-mode=flang -### %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-OBJ %s ! CHECK-EMIT-OBJ-DAG: "-emit-obj" ! CHECK-EMIT-OBJ-DAG: "-o" "{{[^"]*}}.o" diff --git a/clang/test/Driver/flang/flang_ucase.F90 b/clang/test/Driver/flang/flang_ucase.F90 --- a/clang/test/Driver/flang/flang_ucase.F90 +++ b/clang/test/Driver/flang/flang_ucase.F90 @@ -22,10 +22,6 @@ ! CHECK-E-DAG: "-E" ! CHECK-E-DAG: "-o" "-" -! RUN: %clang --driver-mode=flang -### -emit-ast %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-AST %s -! CHECK-EMIT-AST-DAG: "-emit-ast" -! CHECK-EMIT-AST-DAG: "-o" "{{[^"]*}}.ast" - ! RUN: %clang --driver-mode=flang -### -fsyntax-only %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-SYNTAX-ONLY %s ! CHECK-SYNTAX-ONLY-NOT: "-o" ! CHECK-SYNTAX-ONLY-DAG: "-fsyntax-only" @@ -42,7 +38,7 @@ ! CHECK-S-DAG: "-S" ! CHECK-S-DAG: "-o" "{{[^"]*}}.s" -! RUN: %clang --driver-mode=flang -### -fintegrated-as %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-OBJ %s +! RUN: %clang --driver-mode=flang -### %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-OBJ %s ! CHECK-EMIT-OBJ-DAG: "-emit-obj" ! CHECK-EMIT-OBJ-DAG: "-o" "{{[^"]*}}.o" diff --git a/flang/test/Driver/driver-help-hidden.f90 b/flang/test/Driver/driver-help-hidden.f90 --- a/flang/test/Driver/driver-help-hidden.f90 +++ b/flang/test/Driver/driver-help-hidden.f90 @@ -13,101 +13,125 @@ ! CHECK:USAGE: flang-new ! CHECK-EMPTY: +! CHECK-NEXT: DRIVER OPTIONS: +! CHECK-NEXT: --driver-mode= Set the driver mode to either 'gcc', 'g++', 'cpp', 'cl' or 'flang' +! CHECK-EMPTY: ! CHECK-NEXT:OPTIONS: -! CHECK-NEXT: -### Print (but do not run) the commands to run for this compilation -! CHECK-NEXT: -cpp Enable predefined and command line preprocessor macros -! CHECK-NEXT: -c Only run preprocess, compile, and assemble steps -! CHECK-NEXT: -D = Define to (or 1 if omitted) -! CHECK-NEXT: -emit-llvm Use the LLVM representation for assembler and object files -! CHECK-NEXT: -E Only run the preprocessor +! CHECK-NEXT: -### Print (but do not run) the commands to run for this compilation +! CHECK-NEXT: -ccc-print-phases Dump list of actions to perform +! CHECK-NEXT: -cpp Enable predefined and command line preprocessor macros +! CHECK-NEXT: -c Only run preprocess, compile, and assemble steps +! CHECK-NEXT: -D = Define to (or 1 if omitted) +! CHECK-NEXT: -emit-llvm Use the LLVM representation for assembler and object files +! CHECK-NEXT: -E Only run the preprocessor ! CHECK-NEXT: -falternative-parameter-statement -! CHECK-NEXT: Enable the old style PARAMETER statement -! CHECK-NEXT: -fapprox-func Allow certain math function calls to be replaced with an approximately equivalent calculation -! CHECK-NEXT: -fbackslash Specify that backslash in string introduces an escape character -! CHECK-NEXT: -fcolor-diagnostics Enable colors in diagnostics -! CHECK-NEXT: -fconvert= Set endian conversion of data for unformatted files -! CHECK-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type -! CHECK-NEXT: -fdefault-integer-8 Set the default integer and logical kind to an 8 byte wide type -! CHECK-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type -! CHECK-NEXT: -ffast-math Allow aggressive, lossy floating-point optimizations -! CHECK-NEXT: -ffixed-form Process source files in fixed form +! CHECK-NEXT: Enable the old style PARAMETER statement +! CHECK-NEXT: -fapprox-func Allow certain math function calls to be replaced with an approximately equivalent calculation +! CHECK-NEXT: -fbackslash Specify that backslash in string introduces an escape character +! CHECK-NEXT: -fcolor-diagnostics Enable colors in diagnostics +! CHECK-NEXT: -fconvert= Set endian conversion of data for unformatted files +! CHECK-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type +! CHECK-NEXT: -fdefault-integer-8 Set the default integer and logical kind to an 8 byte wide type +! CHECK-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type +! CHECK-NEXT: -ffast-math Allow aggressive, lossy floating-point optimizations +! CHECK-NEXT: -ffixed-form Process source files in fixed form ! CHECK-NEXT: -ffixed-line-length= -! CHECK-NEXT: Use as character line width in fixed mode -! CHECK-NEXT: -ffp-contract= Form fused FP ops (e.g. FMAs) -! CHECK-NEXT: -ffree-form Process source files in free form -! CHECK-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements +! CHECK-NEXT: Use as character line width in fixed mode +! CHECK-NEXT: -ffp-contract= Form fused FP ops (e.g. FMAs) +! CHECK-NEXT: -ffree-form Process source files in free form +! CHECK-NEXT: -fhonor-infinities Specify that floating-point optimizations are not allowed that assume arguments and results are not +-inf. +! CHECK-NEXT: -fhonor-nans Specify that floating-point optimizations are not allowed that assume arguments and results are not NANs. +! CHECK-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements ! CHECK-NEXT: -finput-charset= Specify the default character set for source files ! CHECK-NEXT: -fintrinsic-modules-path -! CHECK-NEXT: Specify where to find the compiled intrinsic modules +! CHECK-NEXT: Specify where to find the compiled intrinsic modules ! CHECK-NEXT: -flang-experimental-hlfir -! CHECK-NEXT: Use HLFIR lowering (experimental) +! CHECK-NEXT: Use HLFIR lowering (experimental) ! CHECK-NEXT: -flang-experimental-polymorphism -! CHECK-NEXT: Enable Fortran 2003 polymorphism (experimental) -! CHECK-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics +! CHECK-NEXT: Enable Fortran 2003 polymorphism (experimental) +! CHECK-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics ! CHECK-NEXT: -flogical-abbreviations Enable logical abbreviations -! CHECK-NEXT: -flto= Set LTO mode -! CHECK-NEXT: -flto Enable LTO in 'full' mode -! CHECK-NEXT: -fno-automatic Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE +! CHECK-NEXT: -flto=auto Enable LTO in 'full' mode +! CHECK-NEXT: -flto=jobserver Enable LTO in 'full' mode +! CHECK-NEXT: -flto= Set LTO mode +! CHECK-NEXT: -flto Enable LTO in 'full' mode +! CHECK-NEXT: -fno-automatic Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE ! CHECK-NEXT: -fno-color-diagnostics Disable colors in diagnostics -! CHECK-NEXT: -fno-integrated-as Disable the integrated assembler +! CHECK-NEXT: -fno-integrated-as Disable the integrated assembler +! CHECK-NEXT: -fno-lto Disable LTO mode (default) ! CHECK-NEXT: -fno-ppc-native-vector-element-order -! CHECK-NEXT: Specifies PowerPC non-native vector element order -! CHECK-NEXT: -fno-signed-zeros Allow optimizations that ignore the sign of floating point zeros -! CHECK-NEXT: -fno-stack-arrays Allocate array temporaries on the heap (default) +! CHECK-NEXT: Specifies PowerPC non-native vector element order +! CHECK-NEXT: -fno-signed-zeros Allow optimizations that ignore the sign of floating point zeros +! CHECK-NEXT: -fno-stack-arrays Allocate array temporaries on the heap (default) ! CHECK-NEXT: -fno-version-loops-for-stride -! CHECK-NEXT: Do not create unit-strided loops (default) -! CHECK-NEXT: -fopenacc Enable OpenACC +! CHECK-NEXT: Do not create unit-strided loops (default) +! CHECK-NEXT: -fopenacc Enable OpenACC +! CHECK-NEXT: -fopenmp-assume-no-nested-parallelism +! CHECK-NEXT: Assert no nested parallel regions in the GPU +! CHECK-NEXT: -fopenmp-assume-no-thread-state +! CHECK-NEXT: Assert no thread in a parallel region modifies an ICV +! CHECK-NEXT: -fopenmp-target-debug Enable debugging in the OpenMP offloading device RTL +! CHECK-NEXT: -fopenmp-targets= +! CHECK-NEXT: Specify comma-separated list of triples OpenMP offloading targets to be supported ! CHECK-NEXT: -fopenmp-version= -! CHECK-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang -! CHECK-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code. +! CHECK-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang +! CHECK-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code. ! CHECK-NEXT: -foptimization-record-file= -! CHECK-NEXT: Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch options. +! CHECK-NEXT: Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch options. ! CHECK-NEXT: -foptimization-record-passes= -! CHECK-NEXT: Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes) +! CHECK-NEXT: Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes) ! CHECK-NEXT: -fpass-plugin= Load pass plugin from a dynamic shared object file (only with new pass manager). ! CHECK-NEXT: -fppc-native-vector-element-order -! CHECK-NEXT: Specifies PowerPC native vector element order -! CHECK-NEXT: -freciprocal-math Allow division operations to be reassociated +! CHECK-NEXT: Specifies PowerPC native vector element order (default) +! CHECK-NEXT: -freciprocal-math Allow division operations to be reassociated ! CHECK-NEXT: -fsave-optimization-record= -! CHECK-NEXT: Generate an optimization record file in a specific format +! CHECK-NEXT: Generate an optimization record file in a specific format ! CHECK-NEXT: -fsave-optimization-record -! CHECK-NEXT: Generate a YAML optimization record file -! CHECK-NEXT: -fstack-arrays Attempt to allocate array temporaries on the stack, no matter their size -! CHECK-NEXT: -fsyntax-only Run the preprocessor, parser and semantic analysis stages -! CHECK-NEXT: -funderscoring Appends one trailing underscore to external names +! CHECK-NEXT: Generate a YAML optimization record file +! CHECK-NEXT: -fstack-arrays Attempt to allocate array temporaries on the stack, no matter their size +! CHECK-NEXT: -fsyntax-only Run the preprocessor, parser and semantic analysis stages +! CHECK-NEXT: -funderscoring Appends one trailing underscore to external names ! CHECK-NEXT: -fversion-loops-for-stride -! CHECK-NEXT: Create unit-strided versions of loops -! CHECK-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV. -! CHECK-NEXT: -gline-tables-only Emit debug line number tables only -! CHECK-NEXT: -g Generate source-level debug information -! CHECK-NEXT: -help Display available options -! CHECK-NEXT: -I Add directory to the end of the list of include search paths -! CHECK-NEXT: -mllvm= Alias for -mllvm -! CHECK-NEXT: -mllvm Additional arguments to forward to LLVM's option processing -! CHECK-NEXT: -mmlir Additional arguments to forward to MLIR's option processing -! CHECK-NEXT: -module-dir Put MODULE files in -! CHECK-NEXT: -nocpp Disable predefined and command line preprocessor macros +! CHECK-NEXT: Create unit-strided versions of loops +! CHECK-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV. +! CHECK-NEXT: -gline-directives-only Emit debug line info directives only +! CHECK-NEXT: -gline-tables-only Emit debug line number tables only +! CHECK-NEXT: -g Generate source-level debug information +! CHECK-NEXT: --help-hidden Display help for hidden options +! CHECK-NEXT: -help Display available options +! CHECK-NEXT: -I Add directory to the end of the list of include search paths +! CHECK-NEXT: -march= For a list of available architectures for the target use '-mcpu=help' +! CHECK-NEXT: -mcpu= For a list of available CPUs for the target use '-mcpu=help' +! CHECK-NEXT: -mllvm= Alias for -mllvm +! CHECK-NEXT: -mllvm Additional arguments to forward to LLVM's option processing +! CHECK-NEXT: -mmlir Additional arguments to forward to MLIR's option processing +! CHECK-NEXT: -module-dir Put MODULE files in +! CHECK-NEXT: --no-offload-arch= +! CHECK-NEXT: Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. 'all' resets the list to its default value. +! CHECK-NEXT: -nocpp Disable predefined and command line preprocessor macros +! CHECK-NEXT: --offload-arch= Specify an offloading device architecture for CUDA, HIP, or OpenMP. (e.g. sm_35). If 'native' is used the compiler will detect locally installed architectures. For HIP offloading, the device architecture can be followed by target ID features delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once. ! CHECK-NEXT: --offload-device-only Only compile for the offloading device. ! CHECK-NEXT: --offload-host-device Compile for both the offloading host and device (default). ! CHECK-NEXT: --offload-host-only Only compile for the offloading host. -! CHECK-NEXT: -o Write output to -! CHECK-NEXT: -pedantic Warn on language extensions +! CHECK-NEXT: -o Write output to +! CHECK-NEXT: -pedantic Warn on language extensions ! CHECK-NEXT: -print-effective-triple Print the effective target triple ! CHECK-NEXT: -print-target-triple Print the normalized target triple -! CHECK-NEXT: -P Disable linemarker output in -E mode +! CHECK-NEXT: -P Disable linemarker output in -E mode ! CHECK-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression ! CHECK-NEXT: -Rpass-missed= Report missed transformations by optimization passes whose name matches the given POSIX regular expression ! CHECK-NEXT: -Rpass= Report transformations performed by optimization passes whose name matches the given POSIX regular expression ! CHECK-NEXT: -R Enable the specified remark -! CHECK-NEXT: -save-temps= Save intermediate compilation results. -! CHECK-NEXT: -save-temps Save intermediate compilation results -! CHECK-NEXT: -std= Language standard to compile for -! CHECK-NEXT: -S Only run preprocess and compilation steps +! CHECK-NEXT: -save-temps= Save intermediate compilation results. +! CHECK-NEXT: -save-temps Save intermediate compilation results +! CHECK-NEXT: -std= Language standard to compile for +! CHECK-NEXT: -S Only run preprocess and compilation steps ! CHECK-NEXT: --target= Generate code for the given target -! CHECK-NEXT: -U Undefine macro -! CHECK-NEXT: --version Print version information -! CHECK-NEXT: -W Enable the specified warning -! CHECK-NEXT: -Xflang Pass to the flang compiler +! CHECK-NEXT: -U Undefine macro +! CHECK-NEXT: --version Print version information +! CHECK-NEXT: -W Enable the specified warning +! CHECK-NEXT: -Xflang Pass to the flang compiler +! CHECK-NEXT: -x Treat subsequent input files as having type ! ERROR-FLANG: error: unknown argument '-help-hidden'; did you mean '--help-hidden'? diff --git a/flang/test/Driver/driver-help.f90 b/flang/test/Driver/driver-help.f90 --- a/flang/test/Driver/driver-help.f90 +++ b/flang/test/Driver/driver-help.f90 @@ -14,224 +14,242 @@ ! HELP:USAGE: flang ! HELP-EMPTY: ! HELP-NEXT:OPTIONS: -! HELP-NEXT: -### Print (but do not run) the commands to run for this compilation -! HELP-NEXT: -cpp Enable predefined and command line preprocessor macros -! HELP-NEXT: -c Only run preprocess, compile, and assemble steps -! HELP-NEXT: -D = Define to (or 1 if omitted) -! HELP-NEXT: -emit-llvm Use the LLVM representation for assembler and object files -! HELP-NEXT: -E Only run the preprocessor +! HELP-NEXT: -### Print (but do not run) the commands to run for this compilation +! HELP-NEXT: -cpp Enable predefined and command line preprocessor macros +! HELP-NEXT: -c Only run preprocess, compile, and assemble steps +! HELP-NEXT: -D = Define to (or 1 if omitted) +! HELP-NEXT: -emit-llvm Use the LLVM representation for assembler and object files +! HELP-NEXT: -E Only run the preprocessor ! HELP-NEXT: -falternative-parameter-statement -! HELP-NEXT: Enable the old style PARAMETER statement -! HELP-NEXT: -fapprox-func Allow certain math function calls to be replaced with an approximately equivalent calculation -! HELP-NEXT: -fbackslash Specify that backslash in string introduces an escape character -! HELP-NEXT: -fcolor-diagnostics Enable colors in diagnostics -! HELP-NEXT: -fconvert= Set endian conversion of data for unformatted files -! HELP-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type -! HELP-NEXT: -fdefault-integer-8 Set the default integer and logical kind to an 8 byte wide type -! HELP-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type -! HELP-NEXT: -ffast-math Allow aggressive, lossy floating-point optimizations -! HELP-NEXT: -ffixed-form Process source files in fixed form +! HELP-NEXT: Enable the old style PARAMETER statement +! HELP-NEXT: -fapprox-func Allow certain math function calls to be replaced with an approximately equivalent calculation +! HELP-NEXT: -fbackslash Specify that backslash in string introduces an escape character +! HELP-NEXT: -fcolor-diagnostics Enable colors in diagnostics +! HELP-NEXT: -fconvert= Set endian conversion of data for unformatted files +! HELP-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type +! HELP-NEXT: -fdefault-integer-8 Set the default integer and logical kind to an 8 byte wide type +! HELP-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type +! HELP-NEXT: -ffast-math Allow aggressive, lossy floating-point optimizations +! HELP-NEXT: -ffixed-form Process source files in fixed form ! HELP-NEXT: -ffixed-line-length= -! HELP-NEXT: Use as character line width in fixed mode -! HELP-NEXT: -ffp-contract= Form fused FP ops (e.g. FMAs) -! HELP-NEXT: -ffree-form Process source files in free form -! HELP-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements +! HELP-NEXT: Use as character line width in fixed mode +! HELP-NEXT: -ffp-contract= Form fused FP ops (e.g. FMAs) +! HELP-NEXT: -ffree-form Process source files in free form +! HELP-NEXT: -fhonor-infinities Specify that floating-point optimizations are not allowed that assume arguments and results are not +-inf. +! HELP-NEXT: -fhonor-nans Specify that floating-point optimizations are not allowed that assume arguments and results are not NANs. +! HELP-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements ! HELP-NEXT: -finput-charset= Specify the default character set for source files ! HELP-NEXT: -fintrinsic-modules-path -! HELP-NEXT: Specify where to find the compiled intrinsic modules -! HELP-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics +! HELP-NEXT: Specify where to find the compiled intrinsic modules +! HELP-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics ! HELP-NEXT: -flogical-abbreviations Enable logical abbreviations -! HELP-NEXT: -flto= Set LTO mode -! HELP-NEXT: -flto Enable LTO in 'full' mode -! HELP-NEXT: -fno-automatic Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE +! HELP-NEXT: -flto=auto Enable LTO in 'full' mode +! HELP-NEXT: -flto=jobserver Enable LTO in 'full' mode +! HELP-NEXT: -flto= Set LTO mode +! HELP-NEXT: -flto Enable LTO in 'full' mode +! HELP-NEXT: -fno-automatic Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE ! HELP-NEXT: -fno-color-diagnostics Disable colors in diagnostics ! HELP-NEXT: -fno-integrated-as Disable the integrated assembler +! HELP-NEXT: -fno-lto Disable LTO mode (default) ! HELP-NEXT: -fno-ppc-native-vector-element-order -! HELP-NEXT: Specifies PowerPC non-native vector element order -! HELP-NEXT: -fno-signed-zeros Allow optimizations that ignore the sign of floating point zeros -! HELP-NEXT: -fno-stack-arrays Allocate array temporaries on the heap (default) +! HELP-NEXT: Specifies PowerPC non-native vector element order +! HELP-NEXT: -fno-signed-zeros Allow optimizations that ignore the sign of floating point zeros +! HELP-NEXT: -fno-stack-arrays Allocate array temporaries on the heap (default) ! HELP-NEXT: -fno-version-loops-for-stride -! HELP-NEXT: Do not create unit-strided loops (default) -! HELP-NEXT: -fopenacc Enable OpenACC +! HELP-NEXT: Do not create unit-strided loops (default) +! HELP-NEXT: -fopenacc Enable OpenACC +! HELP-NEXT: -fopenmp-target-debug Enable debugging in the OpenMP offloading device RTL +! HELP-NEXT: -fopenmp-targets= +! HELP-NEXT: Specify comma-separated list of triples OpenMP offloading targets to be supported ! HELP-NEXT: -fopenmp-version= -! HELP-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang -! HELP-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code. +! HELP-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang +! HELP-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code. ! HELP-NEXT: -foptimization-record-file= -! HELP-NEXT: Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch options. +! HELP-NEXT: Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch options. ! HELP-NEXT: -foptimization-record-passes= -! HELP-NEXT: Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes) +! HELP-NEXT: Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes) ! HELP-NEXT: -fpass-plugin= Load pass plugin from a dynamic shared object file (only with new pass manager). ! HELP-NEXT: -fppc-native-vector-element-order -! HELP-NEXT: Specifies PowerPC native vector element order -! HELP-NEXT: -freciprocal-math Allow division operations to be reassociated +! HELP-NEXT: Specifies PowerPC native vector element order (default) +! HELP-NEXT: -freciprocal-math Allow division operations to be reassociated ! HELP-NEXT: -fsave-optimization-record= -! HELP-NEXT: Generate an optimization record file in a specific format +! HELP-NEXT: Generate an optimization record file in a specific format ! HELP-NEXT: -fsave-optimization-record -! HELP-NEXT: Generate a YAML optimization record file -! HELP-NEXT: -fstack-arrays Attempt to allocate array temporaries on the stack, no matter their size -! HELP-NEXT: -fsyntax-only Run the preprocessor, parser and semantic analysis stages -! HELP-NEXT: -funderscoring Appends one trailing underscore to external names +! HELP-NEXT: Generate a YAML optimization record file +! HELP-NEXT: -fstack-arrays Attempt to allocate array temporaries on the stack, no matter their size +! HELP-NEXT: -fsyntax-only Run the preprocessor, parser and semantic analysis stages +! HELP-NEXT: -funderscoring Appends one trailing underscore to external names ! HELP-NEXT: -fversion-loops-for-stride -! HELP-NEXT: Create unit-strided versions of loops -! HELP-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV. -! HELP-NEXT: -gline-tables-only Emit debug line number tables only -! HELP-NEXT: -g Generate source-level debug information -! HELP-NEXT: -help Display available options -! HELP-NEXT: -I Add directory to the end of the list of include search paths -! HELP-NEXT: -mllvm= Alias for -mllvm -! HELP-NEXT: -mllvm Additional arguments to forward to LLVM's option processing -! HELP-NEXT: -mmlir Additional arguments to forward to MLIR's option processing -! HELP-NEXT: -module-dir Put MODULE files in -! HELP-NEXT: -nocpp Disable predefined and command line preprocessor macros +! HELP-NEXT: Create unit-strided versions of loops +! HELP-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV. +! HELP-NEXT: -gline-directives-only Emit debug line info directives only +! HELP-NEXT: -gline-tables-only Emit debug line number tables only +! HELP-NEXT: -g Generate source-level debug information +! HELP-NEXT: --help-hidden Display help for hidden options +! HELP-NEXT: -help Display available options +! HELP-NEXT: -I Add directory to the end of the list of include search paths +! HELP-NEXT: -march= For a list of available architectures for the target use '-mcpu=help' +! HELP-NEXT: -mcpu= For a list of available CPUs for the target use '-mcpu=help' +! HELP-NEXT: -mllvm= Alias for -mllvm +! HELP-NEXT: -mllvm Additional arguments to forward to LLVM's option processing +! HELP-NEXT: -mmlir Additional arguments to forward to MLIR's option processing +! HELP-NEXT: -module-dir Put MODULE files in +! HELP-NEXT: --no-offload-arch= +! HELP-NEXT: Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. 'all' resets the list to its default value. +! HELP-NEXT: -nocpp Disable predefined and command line preprocessor macros +! HELP-NEXT: --offload-arch= Specify an offloading device architecture for CUDA, HIP, or OpenMP. (e.g. sm_35). If 'native' is used the compiler will detect locally installed architectures. For HIP offloading, the device architecture can be followed by target ID features delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once. ! HELP-NEXT: --offload-device-only Only compile for the offloading device. ! HELP-NEXT: --offload-host-device Compile for both the offloading host and device (default). ! HELP-NEXT: --offload-host-only Only compile for the offloading host. -! HELP-NEXT: -o Write output to -! HELP-NEXT: -pedantic Warn on language extensions +! HELP-NEXT: -o Write output to +! HELP-NEXT: -pedantic Warn on language extensions ! HELP-NEXT: -print-effective-triple Print the effective target triple ! HELP-NEXT: -print-target-triple Print the normalized target triple -! HELP-NEXT: -P Disable linemarker output in -E mode +! HELP-NEXT: -P Disable linemarker output in -E mode ! HELP-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression ! HELP-NEXT: -Rpass-missed= Report missed transformations by optimization passes whose name matches the given POSIX regular expression ! HELP-NEXT: -Rpass= Report transformations performed by optimization passes whose name matches the given POSIX regular expression ! HELP-NEXT: -R Enable the specified remark -! HELP-NEXT: -save-temps= Save intermediate compilation results. -! HELP-NEXT: -save-temps Save intermediate compilation results -! HELP-NEXT: -std= Language standard to compile for -! HELP-NEXT: -S Only run preprocess and compilation steps -! HELP-NEXT: --target= Generate code for the given target -! HELP-NEXT: -U Undefine macro -! HELP-NEXT: --version Print version information -! HELP-NEXT: -W Enable the specified warning -! HELP-NEXT: -Xflang Pass to the flang compiler +! HELP-NEXT: -save-temps= Save intermediate compilation results. +! HELP-NEXT: -save-temps Save intermediate compilation results +! HELP-NEXT: -std= Language standard to compile for +! HELP-NEXT: -S Only run preprocess and compilation steps +! HELP-NEXT: --target= Generate code for the given target +! HELP-NEXT: -U Undefine macro +! HELP-NEXT: --version Print version information +! HELP-NEXT: -W Enable the specified warning +! HELP-NEXT: -Xflang Pass to the flang compiler +! HELP-NEXT: -x Treat subsequent input files as having type + ! HELP-FC1:USAGE: flang ! HELP-FC1-EMPTY: ! HELP-FC1-NEXT:OPTIONS: -! HELP-FC1-NEXT: -cpp Enable predefined and command line preprocessor macros -! HELP-FC1-NEXT: -D = Define to (or 1 if omitted) -! HELP-FC1-NEXT: -emit-fir Build the parse tree, then lower it to FIR -! HELP-FC1-NEXT: -emit-hlfir Build the parse tree, then lower it to HLFIR -! HELP-FC1-NEXT: -emit-llvm-bc Build ASTs then convert to LLVM, emit .bc file -! HELP-FC1-NEXT: -emit-llvm Use the LLVM representation for assembler and object files -! HELP-FC1-NEXT: -emit-obj Emit native object files -! HELP-FC1-NEXT: -E Only run the preprocessor +! HELP-FC1-NEXT: -cpp Enable predefined and command line preprocessor macros +! HELP-FC1-NEXT: -D = Define to (or 1 if omitted) +! HELP-FC1-NEXT: -emit-fir Build the parse tree, then lower it to FIR +! HELP-FC1-NEXT: -emit-hlfir Build the parse tree, then lower it to HLFIR +! HELP-FC1-NEXT: -emit-llvm-bc Build ASTs then convert to LLVM, emit .bc file +! HELP-FC1-NEXT: -emit-llvm Use the LLVM representation for assembler and object files +! HELP-FC1-NEXT: -emit-obj Emit native object files +! HELP-FC1-NEXT: -E Only run the preprocessor ! HELP-FC1-NEXT: -falternative-parameter-statement -! HELP-FC1-NEXT: Enable the old style PARAMETER statement -! HELP-FC1-NEXT: -fapprox-func Allow certain math function calls to be replaced with an approximately equivalent calculation -! HELP-FC1-NEXT: -fbackslash Specify that backslash in string introduces an escape character +! HELP-FC1-NEXT: Enable the old style PARAMETER statement +! HELP-FC1-NEXT: -fapprox-func Allow certain math function calls to be replaced with an approximately equivalent calculation +! HELP-FC1-NEXT: -fbackslash Specify that backslash in string introduces an escape character ! HELP-FC1-NEXT: -fcolor-diagnostics Enable colors in diagnostics -! HELP-FC1-NEXT: -fconvert= Set endian conversion of data for unformatted files -! HELP-FC1-NEXT: -fdebug-dump-all Dump symbols and the parse tree after the semantic checks +! HELP-FC1-NEXT: -fconvert= Set endian conversion of data for unformatted files +! HELP-FC1-NEXT: -fdebug-dump-all Dump symbols and the parse tree after the semantic checks ! HELP-FC1-NEXT: -fdebug-dump-parse-tree-no-sema -! HELP-FC1-NEXT: Dump the parse tree (skips the semantic checks) +! HELP-FC1-NEXT: Dump the parse tree (skips the semantic checks) ! HELP-FC1-NEXT: -fdebug-dump-parse-tree Dump the parse tree ! HELP-FC1-NEXT: -fdebug-dump-parsing-log -! HELP-FC1-NEXT: Run instrumented parse and dump the parsing log +! HELP-FC1-NEXT: Run instrumented parse and dump the parsing log ! HELP-FC1-NEXT: -fdebug-dump-pft Dump the pre-fir parse tree ! HELP-FC1-NEXT: -fdebug-dump-provenance Dump provenance ! HELP-FC1-NEXT: -fdebug-dump-symbols Dump symbols after the semantic analysis ! HELP-FC1-NEXT: -fdebug-measure-parse-tree ! HELP-FC1-NEXT: Measure the parse tree ! HELP-FC1-NEXT: -fdebug-module-writer Enable debug messages while writing module files -! HELP-FC1-NEXT: -fdebug-pass-manager Prints debug information for the new pass manage +! HELP-FC1-NEXT: -fdebug-pass-manager Prints debug information for the new pass manager ! HELP-FC1-NEXT: -fdebug-pre-fir-tree Dump the pre-FIR tree ! HELP-FC1-NEXT: -fdebug-unparse-no-sema Unparse and stop (skips the semantic checks) ! HELP-FC1-NEXT: -fdebug-unparse-with-symbols -! HELP-FC1-NEXT: Unparse and stop. -! HELP-FC1-NEXT: -fdebug-unparse Unparse and stop. -! HELP-FC1-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type -! HELP-FC1-NEXT: -fdefault-integer-8 Set the default integer and logical kind to an 8 byte wide type -! HELP-FC1-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type +! HELP-FC1-NEXT: Unparse and stop. +! HELP-FC1-NEXT: -fdebug-unparse Unparse and stop. +! HELP-FC1-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type +! HELP-FC1-NEXT: -fdefault-integer-8 Set the default integer and logical kind to an 8 byte wide type +! HELP-FC1-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type ! HELP-FC1-NEXT: -fembed-offload-object= -! HELP-FC1-NEXT: Embed Offloading device-side binary into host object file as a section. -! HELP-FC1-NEXT: -ffast-math Allow aggressive, lossy floating-point optimizations -! HELP-FC1-NEXT: -ffixed-form Process source files in fixed form +! HELP-FC1-NEXT: Embed Offloading device-side binary into host object file as a section. +! HELP-FC1-NEXT: -ffast-math Allow aggressive, lossy floating-point optimizations +! HELP-FC1-NEXT: -ffixed-form Process source files in fixed form ! HELP-FC1-NEXT: -ffixed-line-length= -! HELP-FC1-NEXT: Use as character line width in fixed mode -! HELP-FC1-NEXT: -ffp-contract= Form fused FP ops (e.g. FMAs) -! HELP-FC1-NEXT: -ffree-form Process source files in free form +! HELP-FC1-NEXT: Use as character line width in fixed mode +! HELP-FC1-NEXT: -ffp-contract= Form fused FP ops (e.g. FMAs) +! HELP-FC1-NEXT: -ffree-form Process source files in free form ! HELP-FC1-NEXT: -fget-definition -! HELP-FC1-NEXT: Get the symbol definition from +! HELP-FC1-NEXT: Get the symbol definition from ! HELP-FC1-NEXT: -fget-symbols-sources Dump symbols and their source code locations -! HELP-FC1-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements +! HELP-FC1-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements ! HELP-FC1-NEXT: -finput-charset= Specify the default character set for source files ! HELP-FC1-NEXT: -fintrinsic-modules-path -! HELP-FC1-NEXT: Specify where to find the compiled intrinsic modules -! HELP-FC1-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics +! HELP-FC1-NEXT: Specify where to find the compiled intrinsic modules +! HELP-FC1-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics ! HELP-FC1-NEXT: -flogical-abbreviations Enable logical abbreviations ! HELP-FC1-NEXT: -flto= Set LTO mode ! HELP-FC1-NEXT: -flto Enable LTO in 'full' mode ! HELP-FC1-NEXT: -fno-analyzed-objects-for-unparse -! HELP-FC1-NEXT: Do not use the analyzed objects when unparsing -! HELP-FC1-NEXT: -fno-automatic Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE +! HELP-FC1-NEXT: Do not use the analyzed objects when unparsing +! HELP-FC1-NEXT: -fno-automatic Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE ! HELP-FC1-NEXT: -fno-debug-pass-manager Disables debug printing for the new pass manager ! HELP-FC1-NEXT: -fno-ppc-native-vector-element-order -! HELP-FC1-NEXT: Specifies PowerPC non-native vector element order -! HELP-FC1-NEXT: -fno-reformat Dump the cooked character stream in -E mode -! HELP-FC1-NEXT: -fno-signed-zeros Allow optimizations that ignore the sign of floating point zeros -! HELP-FC1-NEXT: -fno-stack-arrays Allocate array temporaries on the heap (default) +! HELP-FC1-NEXT: Specifies PowerPC non-native vector element order +! HELP-FC1-NEXT: -fno-reformat Dump the cooked character stream in -E mode +! HELP-FC1-NEXT: -fno-signed-zeros Allow optimizations that ignore the sign of floating point zeros +! HELP-FC1-NEXT: -fno-stack-arrays Allocate array temporaries on the heap (default) ! HELP-FC1-NEXT: -fno-version-loops-for-stride -! HELP-FC1-NEXT: Do not create unit-strided loops (default) -! HELP-FC1-NEXT: -fopenacc Enable OpenACC -! HELP-FC1-NEXT: -fopenmp-host-ir-file-path -! HELP-FC1-NEXT: Path to the IR file produced by the frontend for the host. +! HELP-FC1-NEXT: Do not create unit-strided loops (default) +! HELP-FC1-NEXT: -fopenacc Enable OpenACC +! HELP-FC1-NEXT: -fopenmp-host-ir-file-path +! HELP-FC1-NEXT: Path to the IR file produced by the frontend for the host. ! HELP-FC1-NEXT: -fopenmp-is-target-device -! HELP-FC1-NEXT: Generate code only for an OpenMP target device. -! HELP-FC1-NEXT: -fopenmp-target-debug Enable debugging in the OpenMP offloading device RTL +! HELP-FC1-NEXT: Generate code only for an OpenMP target device. +! HELP-FC1-NEXT: -fopenmp-target-debug Enable debugging in the OpenMP offloading device RTL ! HELP-FC1-NEXT: -fopenmp-version= -! HELP-FC1-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang -! HELP-FC1-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code. +! HELP-FC1-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang +! HELP-FC1-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code. ! HELP-FC1-NEXT: -fpass-plugin= Load pass plugin from a dynamic shared object file (only with new pass manager). ! HELP-FC1-NEXT: -fppc-native-vector-element-order -! HELP-FC1-NEXT: Specifies PowerPC native vector element order -! HELP-FC1-NEXT: -freciprocal-math Allow division operations to be reassociated -! HELP-FC1-NEXT: -fstack-arrays Attempt to allocate array temporaries on the stack, no matter their size -! HELP-FC1-NEXT: -fsyntax-only Run the preprocessor, parser and semantic analysis stages -! HELP-FC1-NEXT: -funderscoring Appends one trailing underscore to external names +! HELP-FC1-NEXT: Specifies PowerPC native vector element order (default) +! HELP-FC1-NEXT: -freciprocal-math Allow division operations to be reassociated +! HELP-FC1-NEXT: -fstack-arrays Attempt to allocate array temporaries on the stack, no matter their size +! HELP-FC1-NEXT: -fsyntax-only Run the preprocessor, parser and semantic analysis stages +! HELP-FC1-NEXT: -funderscoring Appends one trailing underscore to external names ! HELP-FC1-NEXT: -fversion-loops-for-stride -! HELP-FC1-NEXT: Create unit-strided versions of loops -! HELP-FC1-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV. -! HELP-FC1-NEXT: -help Display available options -! HELP-FC1-NEXT: -init-only Only execute frontend initialization -! HELP-FC1-NEXT: -I Add directory to the end of the list of include search paths -! HELP-FC1-NEXT: -load Load the named plugin (dynamic shared object) -! HELP-FC1-NEXT: -menable-no-infs Allow optimization to assume there are no infinities. -! HELP-FC1-NEXT: -menable-no-nans Allow optimization to assume there are no NaNs. -! HELP-FC1-NEXT: -mllvm Additional arguments to forward to LLVM's option processing -! HELP-FC1-NEXT: -mmlir Additional arguments to forward to MLIR's option processing -! HELP-FC1-NEXT: -module-dir Put MODULE files in +! HELP-FC1-NEXT: Create unit-strided versions of loops +! HELP-FC1-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV. +! HELP-FC1-NEXT: -help Display available options +! HELP-FC1-NEXT: -init-only Only execute frontend initialization +! HELP-FC1-NEXT: -I Add directory to the end of the list of include search paths +! HELP-FC1-NEXT: -load Load the named plugin (dynamic shared object) +! HELP-FC1-NEXT: -menable-no-infs Allow optimization to assume there are no infinities. +! HELP-FC1-NEXT: -menable-no-nans Allow optimization to assume there are no NaNs. +! HELP-FC1-NEXT: -mllvm Additional arguments to forward to LLVM's option processing +! HELP-FC1-NEXT: -mmlir Additional arguments to forward to MLIR's option processing +! HELP-FC1-NEXT: -module-dir Put MODULE files in ! HELP-FC1-NEXT: -module-suffix Use as the suffix for module files (the default value is `.mod`) -! HELP-FC1-NEXT: -mreassociate Allow reassociation transformations for floating-point instructions +! HELP-FC1-NEXT: -mreassociate Allow reassociation transformations for floating-point instructions ! HELP-FC1-NEXT: -mrelocation-model -! HELP-FC1-NEXT: The relocation model to use -! HELP-FC1-NEXT: -nocpp Disable predefined and command line preprocessor macros +! HELP-FC1-NEXT: The relocation model to use +! HELP-FC1-NEXT: -nocpp Disable predefined and command line preprocessor macros ! HELP-FC1-NEXT: -opt-record-file -! HELP-FC1-NEXT: File name to use for YAML optimization record output +! HELP-FC1-NEXT: File name to use for YAML optimization record output ! HELP-FC1-NEXT: -opt-record-format -! HELP-FC1-NEXT: The format used for serializing remarks (default: YAML) +! HELP-FC1-NEXT: The format used for serializing remarks (default: YAML) ! HELP-FC1-NEXT: -opt-record-passes -! HELP-FC1-NEXT: Only record remark information for passes whose names match the given regular expression -! HELP-FC1-NEXT: -o Write output to -! HELP-FC1-NEXT: -pedantic Warn on language extensions +! HELP-FC1-NEXT: Only record remark information for passes whose names match the given regular expression +! HELP-FC1-NEXT: -o Write output to +! HELP-FC1-NEXT: -pedantic Warn on language extensions ! HELP-FC1-NEXT: -pic-is-pie File is for a position independent executable ! HELP-FC1-NEXT: -pic-level Value for __PIC__ -! HELP-FC1-NEXT: -plugin Use the named plugin action instead of the default action (use "help" to list available options) -! HELP-FC1-NEXT: -P Disable linemarker output in -E mode +! HELP-FC1-NEXT: -plugin Use the named plugin action instead of the default action (use "help" to list available options) +! HELP-FC1-NEXT: -P Disable linemarker output in -E mode ! HELP-FC1-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression ! HELP-FC1-NEXT: -Rpass-missed= Report missed transformations by optimization passes whose name matches the given POSIX regular expression ! HELP-FC1-NEXT: -Rpass= Report transformations performed by optimization passes whose name matches the given POSIX regular expression ! HELP-FC1-NEXT: -R Enable the specified remark -! HELP-FC1-NEXT: -save-temps= Save intermediate compilation results. -! HELP-FC1-NEXT: -save-temps Save intermediate compilation results -! HELP-FC1-NEXT: -std= Language standard to compile for -! HELP-FC1-NEXT: -S Only run preprocess and compilation steps -! HELP-FC1-NEXT: -target-cpu Target a specific cpu type +! HELP-FC1-NEXT: -save-temps= Save intermediate compilation results. +! HELP-FC1-NEXT: -save-temps Save intermediate compilation results +! HELP-FC1-NEXT: -std= Language standard to compile for +! HELP-FC1-NEXT: -S Only run preprocess and compilation steps +! HELP-FC1-NEXT: -target-cpu Target a specific cpu type ! HELP-FC1-NEXT: -target-feature Target specific attributes -! HELP-FC1-NEXT: -test-io Run the InputOuputTest action. Use for development and testing only. -! HELP-FC1-NEXT: -triple Specify target triple (e.g. i686-apple-darwin9) -! HELP-FC1-NEXT: -U Undefine macro -! HELP-FC1-NEXT: -version Print the compiler version -! HELP-FC1-NEXT: -W Enable the specified warning +! HELP-FC1-NEXT: -test-io Run the InputOuputTest action. Use for development and testing only. +! HELP-FC1-NEXT: -triple Specify target triple (e.g. i686-apple-darwin9) +! HELP-FC1-NEXT: -U Undefine macro +! HELP-FC1-NEXT: -version Print the compiler version +! HELP-FC1-NEXT: -W Enable the specified warning +! HELP-FC1-NEXT: -x Treat subsequent input files as having type ! ERROR: error: unknown argument '-helps'; did you mean '-help' diff --git a/flang/test/Driver/fast_math.f90 b/flang/test/Driver/fast_math.f90 --- a/flang/test/Driver/fast_math.f90 +++ b/flang/test/Driver/fast_math.f90 @@ -70,7 +70,7 @@ ! UNSUPPORTED: system-windows ! UNSUPPORTED: target=powerpc{{.*}} ! RUN: %flang -ffast-math -### %s -o %t 2>&1 \ -! RUN: --target=x86_64-unknown-linux -no-pie --gcc-toolchain="" \ +! RUN: --target=x86_64-unknown-linux -no-pie \ ! RUN: --sysroot=%S/../../../clang/test/Driver/Inputs/basic_linux_tree \ ! RUN: | FileCheck --check-prefix=CHECK-CRT %s ! CHECK-CRT: {{crtbegin.?\.o}}