2011-11-05 03:28:44 +08:00
|
|
|
// Check to make sure clang is somewhat picky about -g options.
|
|
|
|
// rdar://10383444
|
|
|
|
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G -check-prefix=G_GDB %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \
|
2015-07-16 13:22:17 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \
|
2015-07-16 13:22:17 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G -check-prefix=G_GDB %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_GDB %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \
|
2015-07-16 13:22:17 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G %s
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: %clang -### -c -glldb %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G -check-prefix=G_LLDB %s
|
|
|
|
// RUN: %clang -### -c -gsce %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G -check-prefix=G_SCE %s
|
2013-07-04 04:45:07 +08:00
|
|
|
|
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-apple-darwin 2>&1 \
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_DARWIN -check-prefix=G_LLDB %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin 2>&1 \
|
2015-07-16 13:22:17 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_DARWIN %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin 2>&1 \
|
2015-07-16 13:22:17 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_DARWIN %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin 2>&1 \
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_DARWIN -check-prefix=G_GDB %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin 2>&1 \
|
2015-09-30 23:55:59 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin 2>&1 \
|
2015-07-16 13:22:17 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_DARWIN %s
|
2013-07-04 04:45:07 +08:00
|
|
|
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd10.0 2>&1 \
|
2016-01-08 06:09:47 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_GDB %s
|
2015-12-20 03:41:48 +08:00
|
|
|
|
2015-10-14 20:25:43 +08:00
|
|
|
// On the PS4, -g defaults to -gno-column-info, and we always generate the
|
|
|
|
// arange section.
|
|
|
|
// RUN: %clang -### -c %s -target x86_64-scei-ps4 2>&1 \
|
2015-10-14 22:45:36 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=NOG_PS4 %s
|
2015-10-14 20:25:43 +08:00
|
|
|
// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_PS4 %s
|
|
|
|
// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_SCE %s
|
|
|
|
// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
|
2015-10-14 20:25:43 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=NOCI %s
|
|
|
|
// RUN: %clang -### -c %s -g -gcolumn-info -target x86_64-scei-ps4 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CI %s
|
|
|
|
|
2013-06-19 09:46:49 +08:00
|
|
|
// RUN: %clang -### -c -gdwarf-2 %s 2>&1 | FileCheck -check-prefix=G_D2 %s
|
2012-06-21 16:22:39 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_NO %s
|
|
|
|
// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
|
|
|
|
// RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: %clang -### -c -glldb -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
|
|
|
|
// RUN: %clang -### -c -glldb -g1 %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_LLDB %s
|
|
|
|
//
|
|
|
|
// PS4 defaults to sce; -ggdb0 changes tuning but turns off debug info,
|
|
|
|
// then -g turns it back on without affecting tuning.
|
|
|
|
// RUN: %clang -### -c -ggdb0 -g -target x86_64-scei-ps4 %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G -check-prefix=G_GDB %s
|
2012-06-21 16:22:39 +08:00
|
|
|
//
|
2014-10-22 03:20:21 +08:00
|
|
|
// RUN: %clang -### -c -g1 %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
2014-03-12 05:05:26 +08:00
|
|
|
// RUN: %clang -### -c -gmlt %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
2012-05-04 15:39:27 +08:00
|
|
|
// RUN: %clang -### -c -gline-tables-only %s 2>&1 \
|
2012-06-21 16:22:39 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
2013-11-21 04:22:14 +08:00
|
|
|
// RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \
|
2014-06-13 11:35:37 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-tables-only %s -target i686-pc-openbsd 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-tables-only %s -target x86_64-pc-freebsd10.0 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \
|
2012-06-21 16:22:39 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin 2>&1 \
|
2014-06-13 11:35:37 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
2014-10-16 13:55:24 +08:00
|
|
|
// RUN: %clang -### -c -gline-tables-only -g %s -target i386-pc-solaris 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
2012-05-29 16:10:34 +08:00
|
|
|
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
|
2012-06-21 16:22:39 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_NO %s
|
|
|
|
//
|
2012-08-03 18:35:06 +08:00
|
|
|
// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches \
|
2014-01-18 10:02:06 +08:00
|
|
|
// RUN: -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
|
2013-06-18 08:03:46 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GIGNORE %s
|
2011-11-05 03:28:44 +08:00
|
|
|
//
|
2013-09-14 06:37:55 +08:00
|
|
|
// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s
|
|
|
|
//
|
2014-02-14 09:27:03 +08:00
|
|
|
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
|
|
|
|
//
|
2014-01-18 10:02:06 +08:00
|
|
|
// RUN: %clang -### -fdebug-types-section %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=FDTS %s
|
|
|
|
//
|
2014-01-28 02:52:43 +08:00
|
|
|
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=NOFDTS %s
|
|
|
|
//
|
2014-07-11 07:29:28 +08:00
|
|
|
// RUN: %clang -### -g -gno-column-info %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=NOCI %s
|
|
|
|
//
|
2015-10-14 20:25:43 +08:00
|
|
|
// RUN: %clang -### -g -target x86_64-unknown-unknown %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=CI %s
|
2014-01-28 02:52:43 +08:00
|
|
|
//
|
2015-08-28 03:46:20 +08:00
|
|
|
// RUN: %clang -### -gmodules %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GEXTREFS %s
|
|
|
|
//
|
2011-11-05 03:28:44 +08:00
|
|
|
// G: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// G: "-debug-info-kind=limited"
|
2013-07-04 04:45:07 +08:00
|
|
|
//
|
|
|
|
// G_DARWIN: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// G_DARWIN: "-dwarf-version=2"
|
2014-02-14 09:27:03 +08:00
|
|
|
//
|
2015-10-14 22:45:36 +08:00
|
|
|
// NOG_PS4: "-cc1"
|
|
|
|
// NOG_PS4-NOT "-dwarf-version=
|
|
|
|
// NOG_PS4: "-generate-arange-section"
|
|
|
|
// NOG_PS4-NOT: "-dwarf-version=
|
|
|
|
//
|
2015-10-14 20:25:43 +08:00
|
|
|
// G_PS4: "-cc1"
|
2015-10-14 22:45:36 +08:00
|
|
|
// G_PS4: "-dwarf-version=
|
2015-10-14 20:25:43 +08:00
|
|
|
// G_PS4: "-generate-arange-section"
|
|
|
|
//
|
2013-06-19 09:46:49 +08:00
|
|
|
// G_D2: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// G_D2: "-dwarf-version=2"
|
2011-11-05 03:28:44 +08:00
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// G_NO: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// G_NO-NOT: -debug-info-kind=
|
2012-05-29 16:10:34 +08:00
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// GLTO_ONLY: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// GLTO_ONLY: "-debug-info-kind=line-tables-only"
|
2012-05-29 16:10:34 +08:00
|
|
|
//
|
2014-06-13 11:35:37 +08:00
|
|
|
// GLTO_ONLY_DWARF2: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// GLTO_ONLY_DWARF2: "-debug-info-kind=line-tables-only"
|
|
|
|
// GLTO_ONLY_DWARF2: "-dwarf-version=2"
|
2014-02-18 01:40:52 +08:00
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// G_ONLY: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// G_ONLY: "-debug-info-kind=limited"
|
2012-05-29 16:10:34 +08:00
|
|
|
//
|
2015-12-20 03:41:48 +08:00
|
|
|
// G_GDB: "-debugger-tuning=gdb"
|
|
|
|
// G_LLDB: "-debugger-tuning=lldb"
|
|
|
|
// G_SCE: "-debugger-tuning=sce"
|
|
|
|
//
|
2015-10-08 12:24:12 +08:00
|
|
|
// These tests assert that "-gline-tables-only" "-g" uses the latter,
|
|
|
|
// but otherwise not caring about the DebugInfoKind.
|
2014-06-13 11:35:37 +08:00
|
|
|
// G_ONLY_DWARF2: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// G_ONLY_DWARF2: "-debug-info-kind={{standalone|limited}}"
|
|
|
|
// G_ONLY_DWARF2: "-dwarf-version=2"
|
2014-02-18 01:40:52 +08:00
|
|
|
//
|
2015-10-08 12:24:12 +08:00
|
|
|
// This tests asserts that "-gline-tables-only" "-g0" disables debug info.
|
2012-06-21 16:22:39 +08:00
|
|
|
// GLTO_NO: "-cc1"
|
2015-10-08 12:24:12 +08:00
|
|
|
// GLTO_NO-NOT: -debug-info-kind=
|
2013-06-18 08:03:46 +08:00
|
|
|
//
|
|
|
|
// GIGNORE-NOT: "argument unused during compilation"
|
2013-09-14 06:37:55 +08:00
|
|
|
//
|
|
|
|
// GOPT: -generate-gnu-dwarf-pub-sections
|
2014-01-18 10:02:06 +08:00
|
|
|
//
|
2014-02-14 09:27:03 +08:00
|
|
|
// GARANGE: -generate-arange-section
|
|
|
|
//
|
2014-01-18 10:02:06 +08:00
|
|
|
// FDTS: "-backend-option" "-generate-type-units"
|
2014-01-28 02:52:43 +08:00
|
|
|
//
|
|
|
|
// NOFDTS-NOT: "-backend-option" "-generate-type-units"
|
2014-07-11 07:29:28 +08:00
|
|
|
//
|
|
|
|
// CI: "-dwarf-column-info"
|
|
|
|
//
|
|
|
|
// NOCI-NOT: "-dwarf-column-info"
|
2015-08-28 03:46:20 +08:00
|
|
|
//
|
2015-10-08 13:02:24 +08:00
|
|
|
// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj" "-debug-info-kind={{standalone|limited}}"
|
2016-01-06 09:37:57 +08:00
|
|
|
|
|
|
|
// RUN: not %clang -cc1 -debug-info-kind=watkind 2>&1 | FileCheck -check-prefix=BADSTRING1 %s
|
|
|
|
// BADSTRING1: error: invalid value 'watkind' in '-debug-info-kind=watkind'
|
|
|
|
// RUN: not %clang -cc1 -debugger-tuning=gmodal 2>&1 | FileCheck -check-prefix=BADSTRING2 %s
|
|
|
|
// BADSTRING2: error: invalid value 'gmodal' in '-debugger-tuning=gmodal'
|