2011-11-05 03:28:44 +08:00
|
|
|
// Check to make sure clang is somewhat picky about -g options.
|
|
|
|
// rdar://10383444
|
|
|
|
|
2016-10-18 04:14:23 +08:00
|
|
|
// Linux.
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_LIMITED -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 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
|
2013-07-04 04:45:07 +08:00
|
|
|
// RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_LIMITED -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 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: %clang -### -c -glldb %s -target x86_64-linux-gnu 2>&1 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_LLDB %s
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: %clang -### -c -gsce %s -target x86_64-linux-gnu 2>&1 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_SCE %s
|
2019-04-05 02:17:46 +08:00
|
|
|
|
|
|
|
// Android.
|
|
|
|
// Android should always generate DWARF4.
|
|
|
|
// RUN: %clang -### -c -g %s -target arm-linux-androideabi 2>&1 \
|
2019-04-16 08:16:29 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DWARF4 %s
|
2013-07-04 04:45:07 +08:00
|
|
|
|
2016-10-18 04:14:23 +08:00
|
|
|
// Darwin.
|
2019-04-05 09:48:11 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-apple-darwin14 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF2 \
|
|
|
|
// RUN: -check-prefix=G_LLDB %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-apple-darwin16 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 \
|
|
|
|
// RUN: -check-prefix=G_LLDB %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin16 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin16 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin16 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 \
|
|
|
|
// RUN: -check-prefix=G_GDB %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin16 2>&1 \
|
2016-09-10 05:10:35 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin16 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.11 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.10 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -g %s -target armv7-apple-ios9.0 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target armv7-apple-ios8.0 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -g %s -target armv7k-apple-watchos 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2019-12-11 07:10:52 +08:00
|
|
|
// RUN: %clang -### -c -fsave-optimization-record %s \
|
|
|
|
// RUN: -target x86_64-apple-darwin 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
|
|
|
// RUN: %clang -### -c -g -fsave-optimization-record %s \
|
|
|
|
// RUN: -target x86_64-apple-darwin 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE %s
|
2013-07-04 04:45:07 +08:00
|
|
|
|
2016-10-18 04:14:23 +08:00
|
|
|
// FreeBSD.
|
2019-09-04 00:30:21 +08:00
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_GDB \
|
|
|
|
// RUN: -check-prefix=G_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd12.0 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_GDB \
|
|
|
|
// RUN: -check-prefix=G_DWARF4 %s
|
2015-12-20 03:41:48 +08:00
|
|
|
|
2018-11-15 06:59:27 +08:00
|
|
|
// Windows.
|
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_GDB %s
|
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-windows-msvc 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_NOTUNING %s
|
|
|
|
// RUN: %clang_cl -### -c -Z7 -target x86_64-windows-msvc -- %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_NOTUNING %s
|
|
|
|
|
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
|
2017-09-30 05:25:07 +08:00
|
|
|
// RUN: %clang -### -c %s -gsce -target x86_64-unknown-linux 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=NOCI %s
|
2015-10-14 20:25:43 +08:00
|
|
|
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: %clang -### -c -gdwarf-2 %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
2012-06-21 16:22:39 +08:00
|
|
|
//
|
2017-05-24 22:57:17 +08:00
|
|
|
// RUN: not %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_ERR %s
|
2012-06-21 16:22:39 +08:00
|
|
|
// 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 \
|
2016-09-10 05:10:35 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
2014-06-13 11:35:37 +08:00
|
|
|
// 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
|
2016-10-18 03:36:18 +08:00
|
|
|
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin16 2>&1 \
|
2016-10-18 04:14:23 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s
|
2014-06-13 11:35:37 +08:00
|
|
|
// 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
|
|
|
|
//
|
2018-08-31 21:56:14 +08:00
|
|
|
// RUN: %clang -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLIO_ONLY %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only %s -target x86_64-pc-freebsd10.0 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-apple-darwin16 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only -g %s -target i686-pc-openbsd 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only -g %s -target i386-pc-solaris 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
|
|
|
// RUN: %clang -### -c -gline-directives-only -g0 %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLIO_NO %s
|
|
|
|
//
|
2017-03-30 07:34:20 +08:00
|
|
|
// RUN: %clang -### -c -grecord-gcc-switches %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GRECORD %s
|
|
|
|
// RUN: %clang -### -c -gno-record-gcc-switches %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GNO_RECORD %s
|
|
|
|
// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GNO_RECORD %s/
|
|
|
|
// RUN: %clang -### -c -grecord-gcc-switches -o - %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GRECORD_O %s
|
|
|
|
// RUN: %clang -### -c -O3 -ffunction-sections -grecord-gcc-switches %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GRECORD_OPT %s
|
|
|
|
//
|
2018-12-14 23:38:15 +08:00
|
|
|
// RUN: %clang -### -c -grecord-command-line %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GRECORD %s
|
|
|
|
// RUN: %clang -### -c -gno-record-command-line %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GNO_RECORD %s
|
|
|
|
// RUN: %clang -### -c -grecord-command-line -gno-record-command-line %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GNO_RECORD %s/
|
|
|
|
// RUN: %clang -### -c -grecord-command-line -o - %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GRECORD_O %s
|
|
|
|
// RUN: %clang -### -c -O3 -ffunction-sections -grecord-command-line %s 2>&1 \
|
|
|
|
// | FileCheck -check-prefix=GRECORD_OPT %s
|
|
|
|
//
|
2017-03-30 07:34:20 +08:00
|
|
|
// RUN: %clang -### -c -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
|
|
|
//
|
2018-08-21 04:14:08 +08:00
|
|
|
// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GPUB %s
|
2018-09-07 01:01:45 +08:00
|
|
|
// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
2018-08-21 04:14:08 +08:00
|
|
|
// RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
|
|
|
// RUN: %clang -### -c -ggnu-pubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
|
|
|
//
|
|
|
|
// RUN: %clang -### -c -gpubnames %s 2>&1 | FileCheck -check-prefix=PUB %s
|
2018-09-07 01:01:45 +08:00
|
|
|
// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
2018-08-21 04:14:08 +08:00
|
|
|
// RUN: %clang -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
|
|
|
// RUN: %clang -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
|
|
|
//
|
|
|
|
// RUN: %clang -### -c -gsplit-dwarf %s 2>&1 | FileCheck -check-prefix=GPUB %s
|
|
|
|
// RUN: %clang -### -c -gsplit-dwarf -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
2013-09-14 06:37:55 +08:00
|
|
|
//
|
2018-11-14 04:08:13 +08:00
|
|
|
// RUN: %clang -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s
|
|
|
|
// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
|
|
|
|
// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
|
|
|
|
//
|
2019-09-10 23:53:18 +08:00
|
|
|
// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
2018-09-07 01:01:45 +08:00
|
|
|
// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
|
|
|
|
//
|
2014-02-14 09:27:03 +08:00
|
|
|
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
|
|
|
|
//
|
2018-07-24 01:50:15 +08:00
|
|
|
// RUN: %clang -### -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \
|
2014-01-18 10:02:06 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=FDTS %s
|
|
|
|
//
|
2018-07-24 01:50:15 +08:00
|
|
|
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-unknown-linux %s 2>&1 \
|
2014-01-28 02:52:43 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=NOFDTS %s
|
|
|
|
//
|
2018-07-24 01:50:15 +08:00
|
|
|
// RUN: %clang -### -fdebug-types-section -target x86_64-apple-darwin %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=FDTSE %s
|
|
|
|
//
|
|
|
|
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-apple-darwin %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=NOFDTSE %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
|
|
|
|
//
|
2016-10-11 05:56:20 +08:00
|
|
|
// RUN: %clang -### -gmodules -g %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GEXTREFS %s
|
|
|
|
//
|
|
|
|
// RUN: %clang -### -gline-tables-only -gmodules %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GEXTREFS %s
|
|
|
|
//
|
|
|
|
// RUN: %clang -### -gmodules -gline-tables-only %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
|
|
|
//
|
2018-11-15 06:59:27 +08:00
|
|
|
// RUN: %clang -### -target %itanium_abi_triple -gmodules -gline-directives-only %s 2>&1 \
|
2018-08-31 21:56:14 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=GLIO_ONLY %s
|
|
|
|
//
|
2015-10-14 22:45:36 +08:00
|
|
|
// NOG_PS4: "-cc1"
|
2020-04-15 00:46:21 +08:00
|
|
|
// NOG_PS4-NOT: "-dwarf-version=
|
2015-10-14 22:45:36 +08:00
|
|
|
// 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"
|
|
|
|
//
|
2017-05-24 22:57:17 +08:00
|
|
|
// G_ERR: error: unknown argument:
|
|
|
|
//
|
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"
|
2016-10-11 05:56:20 +08:00
|
|
|
// GLTO_ONLY-NOT: "-dwarf-ext-refs"
|
2015-10-08 12:24:12 +08:00
|
|
|
// GLTO_ONLY: "-debug-info-kind=line-tables-only"
|
2016-10-11 05:56:20 +08:00
|
|
|
// GLTO_ONLY-NOT: "-dwarf-ext-refs"
|
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
|
|
|
//
|
2018-08-31 21:56:14 +08:00
|
|
|
// GLIO_ONLY: "-cc1"
|
|
|
|
// GLIO_ONLY-NOT: "-dwarf-ext-refs"
|
|
|
|
// GLIO_ONLY: "-debug-info-kind=line-directives-only"
|
|
|
|
// GLIO_ONLY-NOT: "-dwarf-ext-refs"
|
|
|
|
//
|
|
|
|
// GLIO_ONLY_DWARF2: "-cc1"
|
|
|
|
// GLIO_ONLY_DWARF2: "-debug-info-kind=line-directives-only"
|
|
|
|
// GLIO_ONLY_DWARF2: "-dwarf-version=2"
|
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// G_ONLY: "-cc1"
|
2020-07-29 02:23:59 +08:00
|
|
|
// G_ONLY: "-debug-info-kind=limited"
|
2012-05-29 16:10:34 +08:00
|
|
|
//
|
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"
|
2020-07-29 02:23:59 +08:00
|
|
|
// G_ONLY_DWARF2: "-debug-info-kind={{standalone|limited}}"
|
2015-10-08 12:24:12 +08:00
|
|
|
// G_ONLY_DWARF2: "-dwarf-version=2"
|
2014-02-18 01:40:52 +08:00
|
|
|
//
|
2016-10-18 04:14:23 +08:00
|
|
|
// G_STANDALONE: "-cc1"
|
|
|
|
// G_STANDALONE: "-debug-info-kind=standalone"
|
2019-04-16 08:16:29 +08:00
|
|
|
// G_LIMITED: "-cc1"
|
2020-07-29 02:23:59 +08:00
|
|
|
// G_LIMITED: "-debug-info-kind=limited"
|
2019-04-05 02:17:46 +08:00
|
|
|
// G_DWARF2: "-dwarf-version=2"
|
2016-10-18 04:14:23 +08:00
|
|
|
// G_DWARF4: "-dwarf-version=4"
|
2016-09-10 05:10:35 +08:00
|
|
|
//
|
2016-10-18 03:36:18 +08:00
|
|
|
// G_GDB: "-debugger-tuning=gdb"
|
|
|
|
// G_LLDB: "-debugger-tuning=lldb"
|
|
|
|
// G_SCE: "-debugger-tuning=sce"
|
|
|
|
//
|
2018-11-15 06:59:27 +08:00
|
|
|
// G_NOTUNING: "-cc1"
|
|
|
|
// G_NOTUNING-NOT: "-debugger-tuning="
|
|
|
|
//
|
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
|
|
|
//
|
2018-08-31 21:56:14 +08:00
|
|
|
// This tests asserts that "-gline-directives-only" "-g0" disables debug info.
|
|
|
|
// GLIO_NO: "-cc1"
|
|
|
|
// GLIO_NO-NOT: -debug-info-kind=
|
|
|
|
//
|
2017-03-30 07:34:20 +08:00
|
|
|
// GRECORD: "-dwarf-debug-flags"
|
|
|
|
// GRECORD: -### -c -grecord-gcc-switches
|
|
|
|
//
|
|
|
|
// GNO_RECORD-NOT: "-dwarf-debug-flags"
|
|
|
|
// GNO_RECORD-NOT: -### -c -grecord-gcc-switches
|
|
|
|
//
|
|
|
|
// GRECORD_O: "-dwarf-debug-flags"
|
|
|
|
// GRECORD_O: -### -c -grecord-gcc-switches -o -
|
|
|
|
//
|
|
|
|
// GRECORD_OPT: -### -c -O3 -ffunction-sections -grecord-gcc-switches
|
|
|
|
//
|
2013-06-18 08:03:46 +08:00
|
|
|
// GIGNORE-NOT: "argument unused during compilation"
|
2013-09-14 06:37:55 +08:00
|
|
|
//
|
2018-08-21 04:14:08 +08:00
|
|
|
// GPUB: -ggnu-pubnames
|
|
|
|
// NOPUB-NOT: -ggnu-pubnames
|
|
|
|
// NOPUB-NOT: -gpubnames
|
|
|
|
//
|
|
|
|
// PUB: -gpubnames
|
2014-01-18 10:02:06 +08:00
|
|
|
//
|
2018-11-14 04:08:13 +08:00
|
|
|
// RNGBSE: -fdebug-ranges-base-address
|
|
|
|
// NORNGBSE-NOT: -fdebug-ranges-base-address
|
|
|
|
//
|
2014-02-14 09:27:03 +08:00
|
|
|
// GARANGE: -generate-arange-section
|
|
|
|
//
|
2018-04-13 06:21:36 +08:00
|
|
|
// FDTS: "-mllvm" "-generate-type-units"
|
2018-07-24 01:50:15 +08:00
|
|
|
// FDTSE: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'
|
2014-01-28 02:52:43 +08:00
|
|
|
//
|
2018-04-13 06:21:36 +08:00
|
|
|
// NOFDTS-NOT: "-mllvm" "-generate-type-units"
|
2018-07-24 01:50:15 +08:00
|
|
|
// NOFDTSE-NOT: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'
|
2014-07-11 07:29:28 +08:00
|
|
|
//
|
2020-07-06 02:47:02 +08:00
|
|
|
// CI-NOT: "-gno-column-info"
|
2014-07-11 07:29:28 +08:00
|
|
|
//
|
2020-07-06 02:47:02 +08:00
|
|
|
// NOCI: "-gno-column-info"
|
2015-08-28 03:46:20 +08:00
|
|
|
//
|
2018-11-15 06:59:27 +08:00
|
|
|
// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj"
|
2020-07-29 02:23:59 +08:00
|
|
|
// GEXTREFS: "-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'
|
2017-02-10 06:07:24 +08:00
|
|
|
|
|
|
|
// RUN: %clang -### -fdebug-macro %s 2>&1 | FileCheck -check-prefix=MACRO %s
|
|
|
|
// RUN: %clang -### -fno-debug-macro %s 2>&1 | FileCheck -check-prefix=NOMACRO %s
|
|
|
|
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=NOMACRO %s
|
|
|
|
// MACRO: "-debug-info-macro"
|
|
|
|
// NOMACRO-NOT: "-debug-info-macro"
|
2018-02-27 01:32:31 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang -### -gdwarf-5 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_5 %s
|
|
|
|
// RUN: %clang -### -gdwarf-2 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_2 %s
|
|
|
|
// RUN: %clang -### -gdwarf-5 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_5 %s
|
|
|
|
// RUN: %clang -### -gdwarf-2 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_2 %s
|
|
|
|
//
|
|
|
|
// GEMBED_5: "-gembed-source"
|
|
|
|
// GEMBED_2: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5'
|
|
|
|
// NOGEMBED_5-NOT: "-gembed-source"
|
|
|
|
// NOGEMBED_2-NOT: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5'
|
2020-08-11 05:52:37 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang -### -g -fno-eliminate-unused-debug-types -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=DEBUG_UNUSED_TYPES %s
|
|
|
|
// DEBUG_UNUSED_TYPES: "-debug-info-kind=unused-types"
|
|
|
|
// DEBUG_UNUSED_TYPES-NOT: "-debug-info-kind=limited"
|
|
|
|
// RUN: %clang -### -g -feliminate-unused-debug-types -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s
|
|
|
|
// RUN: %clang -### -fno-eliminate-unused-debug-types -g1 -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s
|
|
|
|
// NO_DEBUG_UNUSED_TYPES: "-debug-info-kind={{limited|line-tables-only|standalone}}"
|
|
|
|
// NO_DEBUG_UNUSED_TYPES-NOT: "-debug-info-kind=unused-types"
|