blob: 981fa908801629dcc6e69933758ec394e8a08065 [file] [log] [blame]
Chad Rosier2875bda2011-11-04 19:28:44 +00001// Check to make sure clang is somewhat picky about -g options.
2// rdar://10383444
3
4// RUN: %clang -### -c -g %s 2>&1 | FileCheck -check-prefix=G %s
Alexey Samsonov7f326072012-06-21 08:22:39 +00005// RUN: %clang -### -c -g2 %s 2>&1 | FileCheck -check-prefix=G %s
6// RUN: %clang -### -c -g3 %s 2>&1 | FileCheck -check-prefix=G %s
7// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=G %s
8// RUN: %clang -### -c -ggdb1 %s 2>&1 | FileCheck -check-prefix=G %s
9// RUN: %clang -### -c -ggdb3 %s 2>&1 | FileCheck -check-prefix=G %s
Manman Renfc0f91c2013-06-19 01:46:49 +000010// RUN: %clang -### -c -gdwarf-2 %s 2>&1 | FileCheck -check-prefix=G_D2 %s
Alexey Samsonov7f326072012-06-21 08:22:39 +000011//
12// RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_NO %s
13// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
14// RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
15//
Alexey Samsonovfd00eec2012-05-04 07:39:27 +000016// RUN: %clang -### -c -gline-tables-only %s 2>&1 \
Alexey Samsonov7f326072012-06-21 08:22:39 +000017// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
Alexey Samsonova9cd83b2012-05-29 08:10:34 +000018// RUN: %clang -### -c -gline-tables-only -g %s 2>&1 \
Alexey Samsonov7f326072012-06-21 08:22:39 +000019// RUN: | FileCheck -check-prefix=G_ONLY %s
Alexey Samsonova9cd83b2012-05-29 08:10:34 +000020// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
Alexey Samsonov7f326072012-06-21 08:22:39 +000021// RUN: | FileCheck -check-prefix=GLTO_NO %s
22//
Benjamin Kramer967d8332012-08-03 10:35:06 +000023// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches \
Eric Christopher3e8ac1b2013-06-18 00:03:50 +000024// RUN: -gstrict-dwarf -gno-strict-dwarf -fdebug-types-section \
25// RUN: -fno-debug-types-section %s 2>&1 \
Eric Christophere7d94642013-06-18 00:03:46 +000026// RUN: | FileCheck -check-prefix=GIGNORE %s
Chad Rosier2875bda2011-11-04 19:28:44 +000027//
28// G: "-cc1"
29// G: "-g"
Manman Renfc0f91c2013-06-19 01:46:49 +000030//
31// G_D2: "-cc1"
32// G_D2: "-gdwarf-2"
Chad Rosier2875bda2011-11-04 19:28:44 +000033//
Alexey Samsonov7f326072012-06-21 08:22:39 +000034// G_NO: "-cc1"
35// G_NO-NOT: "-g"
Chad Rosier670326f2012-02-28 20:49:04 +000036//
Alexey Samsonov7f326072012-06-21 08:22:39 +000037// GLTO_ONLY: "-cc1"
38// GLTO_ONLY-NOT: "-g"
39// GLTO_ONLY: "-gline-tables-only"
40// GLTO_ONLY-NOT: "-g"
Chad Rosier2875bda2011-11-04 19:28:44 +000041//
Alexey Samsonov7f326072012-06-21 08:22:39 +000042// G_ONLY: "-cc1"
43// G_ONLY-NOT: "-gline-tables-only"
44// G_ONLY: "-g"
45// G_ONLY-NOT: "-gline-tables-only"
Chad Rosier2875bda2011-11-04 19:28:44 +000046//
Alexey Samsonov7f326072012-06-21 08:22:39 +000047// GLTO_NO: "-cc1"
48// GLTO_NO-NOT: "-gline-tables-only"
Eric Christophere7d94642013-06-18 00:03:46 +000049//
50// GIGNORE-NOT: "argument unused during compilation"