blob: 490b74656c67ca4481966911716107deb7b3497b [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"
Manman Ren8ed38d82013-07-02 23:15:25 +000029// Can be -gdwarf.
30// G: "-g
Manman Renfc0f91c2013-06-19 01:46:49 +000031//
32// G_D2: "-cc1"
33// G_D2: "-gdwarf-2"
Chad Rosier2875bda2011-11-04 19:28:44 +000034//
Alexey Samsonov7f326072012-06-21 08:22:39 +000035// G_NO: "-cc1"
36// G_NO-NOT: "-g"
Chad Rosier670326f2012-02-28 20:49:04 +000037//
Alexey Samsonov7f326072012-06-21 08:22:39 +000038// GLTO_ONLY: "-cc1"
39// GLTO_ONLY-NOT: "-g"
40// GLTO_ONLY: "-gline-tables-only"
41// GLTO_ONLY-NOT: "-g"
Chad Rosier2875bda2011-11-04 19:28:44 +000042//
Alexey Samsonov7f326072012-06-21 08:22:39 +000043// G_ONLY: "-cc1"
44// G_ONLY-NOT: "-gline-tables-only"
Manman Ren8ed38d82013-07-02 23:15:25 +000045// G_ONLY: "-g
Alexey Samsonov7f326072012-06-21 08:22:39 +000046// G_ONLY-NOT: "-gline-tables-only"
Chad Rosier2875bda2011-11-04 19:28:44 +000047//
Alexey Samsonov7f326072012-06-21 08:22:39 +000048// GLTO_NO: "-cc1"
49// GLTO_NO-NOT: "-gline-tables-only"
Eric Christophere7d94642013-06-18 00:03:46 +000050//
51// GIGNORE-NOT: "argument unused during compilation"