Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -7178,9 +7178,12 @@ CmdArgs.push_back("-c"); - if (Args.hasArg(options::OPT_g_Group)) { + if (Args.hasArg(options::OPT_v)) + CmdArgs.push_back("-v"); + + if (Args.hasArg(options::OPT_g_Group)) CmdArgs.push_back("-g"); - } + if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm, false)) CmdArgs.push_back("-fverbose-asm"); @@ -7213,6 +7216,9 @@ assert(Output.isNothing() && "Invalid output."); } + if (Args.hasArg(options::OPT_v)) + CmdArgs.push_back("-v"); + ExceptionSettings EH = exceptionSettings(Args, getToolChain().getTriple()); if (EH.ShouldUseExceptionTables) CmdArgs.push_back("-fexceptions"); Index: test/Driver/xcore-opts.c =================================================================== --- test/Driver/xcore-opts.c +++ test/Driver/xcore-opts.c @@ -1,5 +1,5 @@ -// RUN: %clang -target xcore %s -g -Wl,L1Arg,L2Arg -Wa,A1Arg,A2Arg -fverbose-asm -### -o %t.o 2>&1 | FileCheck %s -// RUN: %clang -target xcore -x c++ %s -g -Wl,L1Arg,L2Arg -Wa,A1Arg,A2Arg -fverbose-asm -### -o %t.o 2>&1 | FileCheck %s +// RUN: %clang -target xcore %s -g -Wl,L1Arg,L2Arg -Wa,A1Arg,A2Arg -fverbose-asm -v -### -o %t.o 2>&1 | FileCheck %s +// RUN: %clang -target xcore -x c++ %s -g -Wl,L1Arg,L2Arg -Wa,A1Arg,A2Arg -fverbose-asm -v -### -o %t.o 2>&1 | FileCheck %s // RUN: %clang -target xcore -x c++ %s -fexceptions -### -o %t.o 2>&1 | FileCheck -check-prefix CHECK-EXCEP %s // CHECK: "-nostdsysteminc" @@ -12,9 +12,10 @@ // CHECK: "-fno-common" // CHECH: xcc" "-o" // CHECK-EXCEP-NOT: "-fexceptions" -// CHECK: "-c" "-g" "-fverbose-asm" "A1Arg" "A2Arg" +// CHECK: "-c" "-v" "-g" "-fverbose-asm" "A1Arg" "A2Arg" // CHECK: xcc" "-o" // CHECK-EXCEP-NOT: "-fexceptions" +// CHECK: "-v" // CHECK: "L1Arg" "L2Arg" // CHECK-EXCEP: "-fno-use-cxa-atexit"