From 2ad368fce35afcf0933afb2cf4074d0c810aac4a Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 28 Feb 2012 20:49:04 +0000 Subject: [PATCH] [driver] Add support for -g2 and -ggdb debug flags. rdar://10947759 llvm-svn: 151654 --- clang/include/clang/Driver/Options.td | 2 ++ clang/test/Driver/debug-options.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index e9c679e17998..a9b8aa9ceb14 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -545,9 +545,11 @@ def ffunction_sections: Flag <"-ffunction-sections">, Group; def fdata_sections : Flag <"-fdata-sections">, Group; def f : Joined<"-f">, Group; def g0 : Flag<"-g0">, Group; +def g2 : Flag<"-g2">, Group; def g3 : Flag<"-g3">, Group; def gdwarf2 : Flag<"-gdwarf-2">, Group; def gfull : Flag<"-gfull">, Group; +def ggdb : Flag<"-ggdb">, Group; def gstabs : Flag<"-gstabs">, Group; def gstabsplus : Flag<"-gstabs+">, Group; def gstabs1 : Flag<"-gstabs1">, Group; diff --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c index 867251971d26..5dad8e938249 100644 --- a/clang/test/Driver/debug-options.c +++ b/clang/test/Driver/debug-options.c @@ -2,18 +2,26 @@ // rdar://10383444 // RUN: %clang -### -c -g %s 2>&1 | FileCheck -check-prefix=G %s +// RUN: %clang -### -c -g2 %s 2>&1 | FileCheck -check-prefix=G2 %s // RUN: %clang -### -c -g3 %s 2>&1 | FileCheck -check-prefix=G3 %s // RUN: %clang -### -c -ganything %s 2>&1 | FileCheck -check-prefix=GANY %s +// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=GGDB %s // RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=GFOO %s // // G: "-cc1" // G: "-g" // +// G2: "-cc1" +// G2: "-g" +// // G3: "-cc1" // G3: "-g" // // GANY: "-cc1" // GANY-NOT: "-g" // +// GGDB: "-cc1" +// GGDB: "-g" +// // GFOO: "-cc1" // GFOO-NOT: "-g"