blob: bdeb6cad918f47422d24b5a353bb020e2fa0e169 [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
10// RUN: %clang -### -c -gdwarf-2 %s 2>&1 | FileCheck -check-prefix=G %s
11//
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//
23// RUN: %clang -c -grecord-gcc-switches -gno-record-gcc-switches \
24// RUN: -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
25// RUN: | not grep "argument unused during compilation"
Chad Rosier2875bda2011-11-04 19:28:44 +000026//
27// G: "-cc1"
28// G: "-g"
29//
Alexey Samsonov7f326072012-06-21 08:22:39 +000030// G_NO: "-cc1"
31// G_NO-NOT: "-g"
Chad Rosier670326f2012-02-28 20:49:04 +000032//
Alexey Samsonov7f326072012-06-21 08:22:39 +000033// GLTO_ONLY: "-cc1"
34// GLTO_ONLY-NOT: "-g"
35// GLTO_ONLY: "-gline-tables-only"
36// GLTO_ONLY-NOT: "-g"
Chad Rosier2875bda2011-11-04 19:28:44 +000037//
Alexey Samsonov7f326072012-06-21 08:22:39 +000038// G_ONLY: "-cc1"
39// G_ONLY-NOT: "-gline-tables-only"
40// G_ONLY: "-g"
41// G_ONLY-NOT: "-gline-tables-only"
Chad Rosier2875bda2011-11-04 19:28:44 +000042//
Alexey Samsonov7f326072012-06-21 08:22:39 +000043// GLTO_NO: "-cc1"
44// GLTO_NO-NOT: "-gline-tables-only"