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 \
|
|
|
|
| FileCheck -check-prefix=G %s
|
|
|
|
// RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G %s
|
|
|
|
// RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G %s
|
|
|
|
// RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G %s
|
|
|
|
// RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G %s
|
|
|
|
// RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -c -g %s -target x86_64-apple-darwin 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G_DARWIN %s
|
|
|
|
// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G_DARWIN %s
|
|
|
|
// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G_DARWIN %s
|
|
|
|
// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G_DARWIN %s
|
|
|
|
// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G_DARWIN %s
|
|
|
|
// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin 2>&1 \
|
|
|
|
| FileCheck -check-prefix=G_DARWIN %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
|
|
|
|
//
|
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 \
|
|
|
|
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DARWIN %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 \
|
|
|
|
// RUN: | FileCheck -check-prefix=G_ONLY_DARWIN %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 \
|
2013-06-18 08:03:50 +08:00
|
|
|
// RUN: -gstrict-dwarf -gno-strict-dwarf -fdebug-types-section \
|
|
|
|
// RUN: -fno-debug-types-section %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
|
|
|
|
//
|
2011-11-05 03:28:44 +08:00
|
|
|
// G: "-cc1"
|
2013-07-04 04:45:07 +08:00
|
|
|
// G: "-g"
|
|
|
|
//
|
|
|
|
// G_DARWIN: "-cc1"
|
|
|
|
// G_DARWIN: "-gdwarf-2"
|
2013-06-19 09:46:49 +08:00
|
|
|
//
|
|
|
|
// G_D2: "-cc1"
|
|
|
|
// G_D2: "-gdwarf-2"
|
2011-11-05 03:28:44 +08:00
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// G_NO: "-cc1"
|
|
|
|
// G_NO-NOT: "-g"
|
2012-05-29 16:10:34 +08:00
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// GLTO_ONLY: "-cc1"
|
|
|
|
// GLTO_ONLY-NOT: "-g"
|
|
|
|
// GLTO_ONLY: "-gline-tables-only"
|
|
|
|
// GLTO_ONLY-NOT: "-g"
|
2012-05-29 16:10:34 +08:00
|
|
|
//
|
2013-11-21 04:22:14 +08:00
|
|
|
// GLTO_ONLY_DARWIN: "-cc1"
|
|
|
|
// GLTO_ONLY_DARWIN-NOT: "-g"
|
|
|
|
// GLTO_ONLY_DARWIN: "-gline-tables-only"
|
|
|
|
// GLTO_ONLY_DARWIN: "-gdwarf-2"
|
|
|
|
// GLTO_ONLY_DARWIN-NOT: "-g"
|
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// G_ONLY: "-cc1"
|
|
|
|
// G_ONLY-NOT: "-gline-tables-only"
|
2013-07-04 04:45:07 +08:00
|
|
|
// G_ONLY: "-g"
|
2012-06-21 16:22:39 +08:00
|
|
|
// G_ONLY-NOT: "-gline-tables-only"
|
2012-05-29 16:10:34 +08:00
|
|
|
//
|
2013-07-04 04:45:07 +08:00
|
|
|
// G_ONLY_DARWIN: "-cc1"
|
|
|
|
// G_ONLY_DARWIN-NOT: "-gline-tables-only"
|
|
|
|
// G_ONLY_DARWIN: "-gdwarf-2"
|
|
|
|
// G_ONLY_DARWIN-NOT: "-gline-tables-only"
|
|
|
|
//
|
2012-06-21 16:22:39 +08:00
|
|
|
// GLTO_NO: "-cc1"
|
|
|
|
// GLTO_NO-NOT: "-gline-tables-only"
|
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
|