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 @@ -1998,17 +1998,17 @@ HelpText<"Store string literals as writable data">; def fzero_initialized_in_bss : Flag<["-"], "fzero-initialized-in-bss">, Group; def ffunction_sections : Flag<["-"], "ffunction-sections">, Group, - Flags<[CC1Option]>, + Flags<[CoreOption, CC1Option]>, HelpText<"Place each function in its own section">; -def fno_function_sections : Flag<["-"], "fno-function-sections">, Group; +def fno_function_sections : Flag<["-"], "fno-function-sections">, Group, Flags<[CoreOption, CC1Option]>; def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group, Flags<[CC1Option, CC1AsOption]>, HelpText<"Place each function's basic blocks in unique sections (ELF Only) : all | labels | none | list=">, DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>, Values<"all,labels,none,list=">; def fdata_sections : Flag <["-"], "fdata-sections">, Group, - Flags<[CC1Option]>, HelpText<"Place each data in its own section">; -def fno_data_sections : Flag <["-"], "fno-data-sections">, Group; + Flags<[CoreOption, CC1Option]>, HelpText<"Place each data in its own section">; +def fno_data_sections : Flag <["-"], "fno-data-sections">, Group, Flags<[CoreOption, CC1Option]>; def fstack_size_section : Flag<["-"], "fstack-size-section">, Group, Flags<[CC1Option]>, HelpText<"Emit section containing metadata on function stack sizes">; def fno_stack_size_section : Flag<["-"], "fno-stack-size-section">, Group, diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -102,9 +102,11 @@ // GS_-NOT: -stack-protector // RUN: %clang_cl /Gy -### -- %s 2>&1 | FileCheck -check-prefix=Gy %s +// RUN: %clang_cl -ffunction-sections -### -- %s 2>&1 | FileCheck -check-prefix=Gy %s // Gy: -ffunction-sections // RUN: %clang_cl /Gy /Gy- -### -- %s 2>&1 | FileCheck -check-prefix=Gy_ %s +// RUN: %clang_cl -fno-function-sections -### -- %s 2>&1 | FileCheck -check-prefix=Gy_ %s // Gy_-NOT: -ffunction-sections // RUN: %clang_cl /Gs -### -- %s 2>&1 | FileCheck -check-prefix=Gs %s @@ -115,9 +117,11 @@ // Gs4096: "-mstack-probe-size=4096" // RUN: %clang_cl /Gw -### -- %s 2>&1 | FileCheck -check-prefix=Gw %s +// RUN: %clang_cl -fdata-sections -### -- %s 2>&1 | FileCheck -check-prefix=Gw %s // Gw: -fdata-sections // RUN: %clang_cl /Gw /Gw- -### -- %s 2>&1 | FileCheck -check-prefix=Gw_ %s +// RUN: %clang_cl -fno-data-sections -### -- %s 2>&1 | FileCheck -check-prefix=Gw_ %s // Gw_-NOT: -fdata-sections // RUN: %clang_cl /Imyincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s @@ -635,11 +639,15 @@ // RUN: -fno-coverage-mapping \ // RUN: -fdiagnostics-color \ // RUN: -fno-diagnostics-color \ +// RUN: -fdata-sections \ +// RUN: -fno-data-sections \ // RUN: -fdebug-compilation-dir . \ // RUN: -fdebug-compilation-dir=. \ // RUN: -fdiagnostics-parseable-fixits \ // RUN: -fdiagnostics-absolute-paths \ // RUN: -ferror-limit=10 \ +// RUN: -ffunction-sections \ +// RUN: -fno-function-sections \ // RUN: -fmsc-version=1800 \ // RUN: -fno-strict-aliasing \ // RUN: -fstrict-aliasing \