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 | |
Manman Ren | e783048 | 2013-07-03 20:45:07 +0000 | [diff] [blame] | 4 | // RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \ |
| 5 | | FileCheck -check-prefix=G %s |
| 6 | // RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \ |
| 7 | | FileCheck -check-prefix=G %s |
| 8 | // RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \ |
| 9 | | FileCheck -check-prefix=G %s |
| 10 | // RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \ |
| 11 | | FileCheck -check-prefix=G %s |
| 12 | // RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \ |
| 13 | | FileCheck -check-prefix=G %s |
| 14 | // RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \ |
| 15 | | FileCheck -check-prefix=G %s |
| 16 | |
| 17 | // RUN: %clang -### -c -g %s -target x86_64-apple-darwin 2>&1 \ |
| 18 | | FileCheck -check-prefix=G_DARWIN %s |
| 19 | // RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin 2>&1 \ |
| 20 | | FileCheck -check-prefix=G_DARWIN %s |
| 21 | // RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin 2>&1 \ |
| 22 | | FileCheck -check-prefix=G_DARWIN %s |
| 23 | // RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin 2>&1 \ |
| 24 | | FileCheck -check-prefix=G_DARWIN %s |
| 25 | // RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin 2>&1 \ |
| 26 | | FileCheck -check-prefix=G_DARWIN %s |
| 27 | // RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin 2>&1 \ |
| 28 | | FileCheck -check-prefix=G_DARWIN %s |
| 29 | |
Manman Ren | fc0f91c | 2013-06-19 01:46:49 +0000 | [diff] [blame] | 30 | // RUN: %clang -### -c -gdwarf-2 %s 2>&1 | FileCheck -check-prefix=G_D2 %s |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 31 | // |
| 32 | // RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_NO %s |
| 33 | // RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s |
| 34 | // RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s |
| 35 | // |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 36 | // RUN: %clang -### -c -g1 %s 2>&1 \ |
| 37 | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 38 | // RUN: %clang -### -c -gmlt %s 2>&1 \ |
| 39 | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s |
Alexey Samsonov | fd00eec | 2012-05-04 07:39:27 +0000 | [diff] [blame] | 40 | // RUN: %clang -### -c -gline-tables-only %s 2>&1 \ |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 41 | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 42 | // RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \ |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 43 | // RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s |
| 44 | // RUN: %clang -### -c -gline-tables-only %s -target i686-pc-openbsd 2>&1 \ |
| 45 | // RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s |
| 46 | // RUN: %clang -### -c -gline-tables-only %s -target x86_64-pc-freebsd10.0 2>&1 \ |
| 47 | // RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s |
Manman Ren | e783048 | 2013-07-03 20:45:07 +0000 | [diff] [blame] | 48 | // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \ |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 49 | // RUN: | FileCheck -check-prefix=G_ONLY %s |
Manman Ren | e783048 | 2013-07-03 20:45:07 +0000 | [diff] [blame] | 50 | // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin 2>&1 \ |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 51 | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s |
| 52 | // RUN: %clang -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \ |
| 53 | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s |
| 54 | // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \ |
| 55 | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 56 | // RUN: %clang -### -c -gline-tables-only -g %s -target i386-pc-solaris 2>&1 \ |
| 57 | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s |
Alexey Samsonov | a9cd83b | 2012-05-29 08:10:34 +0000 | [diff] [blame] | 58 | // RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \ |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 59 | // RUN: | FileCheck -check-prefix=GLTO_NO %s |
| 60 | // |
Benjamin Kramer | 967d833 | 2012-08-03 10:35:06 +0000 | [diff] [blame] | 61 | // RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches \ |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 62 | // RUN: -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \ |
Eric Christopher | e7d9464 | 2013-06-18 00:03:46 +0000 | [diff] [blame] | 63 | // RUN: | FileCheck -check-prefix=GIGNORE %s |
Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 64 | // |
Eric Christopher | 0f43a6d | 2013-09-13 22:37:55 +0000 | [diff] [blame] | 65 | // RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s |
| 66 | // |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 67 | // RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s |
| 68 | // |
| 69 | // RUN: %clang -### -fdebug-types-section %s 2>&1 \ |
| 70 | // RUN: | FileCheck -check-prefix=FDTS %s |
| 71 | // |
| 72 | // RUN: %clang -### -fdebug-types-section -fno-debug-types-section %s 2>&1 \ |
| 73 | // RUN: | FileCheck -check-prefix=NOFDTS %s |
| 74 | // |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 75 | // RUN: %clang -### -g -gno-column-info %s 2>&1 \ |
| 76 | // RUN: | FileCheck -check-prefix=NOCI %s |
| 77 | // |
| 78 | // RUN: %clang -### -g %s 2>&1 | FileCheck -check-prefix=CI %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 79 | // |
Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 80 | // G: "-cc1" |
Manman Ren | e783048 | 2013-07-03 20:45:07 +0000 | [diff] [blame] | 81 | // G: "-g" |
| 82 | // |
| 83 | // G_DARWIN: "-cc1" |
| 84 | // G_DARWIN: "-gdwarf-2" |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 85 | // |
Manman Ren | fc0f91c | 2013-06-19 01:46:49 +0000 | [diff] [blame] | 86 | // G_D2: "-cc1" |
| 87 | // G_D2: "-gdwarf-2" |
Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 88 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 89 | // G_NO: "-cc1" |
| 90 | // G_NO-NOT: "-g" |
Chad Rosier | 670326f | 2012-02-28 20:49:04 +0000 | [diff] [blame] | 91 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 92 | // GLTO_ONLY: "-cc1" |
| 93 | // GLTO_ONLY-NOT: "-g" |
| 94 | // GLTO_ONLY: "-gline-tables-only" |
| 95 | // GLTO_ONLY-NOT: "-g" |
Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 96 | // |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 97 | // GLTO_ONLY_DWARF2: "-cc1" |
| 98 | // GLTO_ONLY_DWARF2-NOT: "-g" |
| 99 | // GLTO_ONLY_DWARF2: "-gline-tables-only" |
| 100 | // GLTO_ONLY_DWARF2: "-gdwarf-2" |
| 101 | // GLTO_ONLY_DWARF2-NOT: "-g" |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 102 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 103 | // G_ONLY: "-cc1" |
| 104 | // G_ONLY-NOT: "-gline-tables-only" |
Manman Ren | e783048 | 2013-07-03 20:45:07 +0000 | [diff] [blame] | 105 | // G_ONLY: "-g" |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 106 | // G_ONLY-NOT: "-gline-tables-only" |
Chad Rosier | 2875bda | 2011-11-04 19:28:44 +0000 | [diff] [blame] | 107 | // |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 108 | // G_ONLY_DWARF2: "-cc1" |
| 109 | // G_ONLY_DWARF2-NOT: "-gline-tables-only" |
| 110 | // G_ONLY_DWARF2: "-gdwarf-2" |
| 111 | // G_ONLY_DWARF2-NOT: "-gline-tables-only" |
Manman Ren | e783048 | 2013-07-03 20:45:07 +0000 | [diff] [blame] | 112 | // |
Alexey Samsonov | 7f32607 | 2012-06-21 08:22:39 +0000 | [diff] [blame] | 113 | // GLTO_NO: "-cc1" |
| 114 | // GLTO_NO-NOT: "-gline-tables-only" |
Eric Christopher | e7d9464 | 2013-06-18 00:03:46 +0000 | [diff] [blame] | 115 | // |
| 116 | // GIGNORE-NOT: "argument unused during compilation" |
Eric Christopher | 0f43a6d | 2013-09-13 22:37:55 +0000 | [diff] [blame] | 117 | // |
| 118 | // GOPT: -generate-gnu-dwarf-pub-sections |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 119 | // |
| 120 | // GARANGE: -generate-arange-section |
| 121 | // |
| 122 | // FDTS: "-backend-option" "-generate-type-units" |
| 123 | // |
| 124 | // NOFDTS-NOT: "-backend-option" "-generate-type-units" |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 125 | // |
| 126 | // CI: "-dwarf-column-info" |
| 127 | // |
| 128 | // NOCI-NOT: "-dwarf-column-info" |