if (Arg *A = Args.getLastArg(options::OPT_frtti, options::OPT_fno_rtti))
CmdArgs.push_back(A->getOption().getID() == options::OPT_frtti ? "/GR"
: "/GR-");
+ if (Arg *A = Args.getLastArg(options::OPT_ffunction_sections,
+ options::OPT_fno_function_sections))
+ CmdArgs.push_back(A->getOption().getID() == options::OPT_ffunction_sections
+ ? "/Gy"
+ : "/Gy-");
if (Args.hasArg(options::OPT_fsyntax_only))
CmdArgs.push_back("/Zs");
if (Args.hasArg(options::OPT_g_Flag, options::OPT_gline_tables_only))
// Note: %s must be preceded by --, otherwise it may be interpreted as a
// command-line option, e.g. on Mac where %s is commonly under /Users.
-// RUN: %clang_cl /fallback /Dfoo=bar /Ubaz /Ifoo /O0 /Ox /GR /GR- /LD /LDd \
-// RUN: /MD /MDd /MTd /MT /FImyheader.h /Zi -### -- %s 2>&1 | FileCheck %s
+// RUN: %clang_cl /fallback /Dfoo=bar /Ubaz /Ifoo /O0 /Ox /GR /GR- /Gy /Gy- \
+// RUN: /LD /LDd /MD /MDd /MTd /MT /FImyheader.h /Zi -### -- %s 2>&1 \
+// RUN: | FileCheck %s
// CHECK: "-fdiagnostics-format" "msvc-fallback"
// CHECK: ||
// CHECK: cl.exe
// CHECK: "-I" "foo"
// CHECK: "/Ox"
// CHECK: "/GR-"
+// CHECK: "/Gy-"
// CHECK: "/Z7"
// CHECK: "/FImyheader.h"
// CHECK: "/LD"