XCore target: fix handling of -g0 flag

llvm-svn: 207833
This commit is contained in:
Robert Lytton 2014-05-02 09:33:25 +00:00
parent 844aeeb15a
commit 894d25c1e0
2 changed files with 8 additions and 2 deletions

View File

@ -7622,8 +7622,9 @@ void XCore::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.hasArg(options::OPT_v))
CmdArgs.push_back("-v");
if (Args.hasArg(options::OPT_g_Group))
CmdArgs.push_back("-g");
if (Arg *A = Args.getLastArg(options::OPT_g_Group))
if (!A->getOption().matches(options::OPT_g0))
CmdArgs.push_back("-g");
if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm,
false))

View File

@ -1,6 +1,7 @@
// 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
// RUN: %clang -target xcore %s -g0 -### -o %t.o 2>&1 | FileCheck -check-prefix CHECK-G0 %s
// CHECK: "-nostdsysteminc"
// CHECK: "-momit-leaf-frame-pointer"
@ -27,3 +28,7 @@
// CHECK-EXCEP: xcc" "-o"
// CHECK-EXCEP: "-fexceptions"
// CHECK-G0: xcc"
// CHECK-G0-NOT: "-g"
// CHECK-G0: xcc"