Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 1 | // 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 Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 5 | // 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 Samsonov | fd00eec | 2012-05-04 07:39:27 +0000 | [diff] [blame] | 16 | // RUN: %clang -### -c -gline-tables-only %s 2>&1 \ |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 17 | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s |
Alexey Samsonov | a9cd83b | 2012-05-29 08:10:34 +0000 | [diff] [blame] | 18 | // RUN: %clang -### -c -gline-tables-only -g %s 2>&1 \ |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 19 | // RUN: | FileCheck -check-prefix=G_ONLY %s |
Alexey Samsonov | a9cd83b | 2012-05-29 08:10:34 +0000 | [diff] [blame] | 20 | // RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \ |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 21 | // 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 Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 26 | // |
| 27 | // G: "-cc1" |
| 28 | // G: "-g" |
| 29 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 30 | // G_NO: "-cc1" |
| 31 | // G_NO-NOT: "-g" |
Chad Rosier | 670326f | 2012-02-28 20:49:04 +0000 | [diff] [blame] | 32 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 33 | // GLTO_ONLY: "-cc1" |
| 34 | // GLTO_ONLY-NOT: "-g" |
| 35 | // GLTO_ONLY: "-gline-tables-only" |
| 36 | // GLTO_ONLY-NOT: "-g" |
Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 37 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 38 | // G_ONLY: "-cc1" |
| 39 | // G_ONLY-NOT: "-gline-tables-only" |
| 40 | // G_ONLY: "-g" |
| 41 | // G_ONLY-NOT: "-gline-tables-only" |
Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 42 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame^] | 43 | // GLTO_NO: "-cc1" |
| 44 | // GLTO_NO-NOT: "-gline-tables-only" |