blob: 51475680e9b183c4729785d050910ce84e329a4b [file] [log] [blame]
NAKAMURA Takumi5a5bb932012-01-12 06:15:01 +00001// Check to make sure clang is somewhat picky about -g options.
2// (Delived from debug-options.c)
3// rdar://10383444
Simon Atanasyane16a8c82012-05-03 13:57:00 +00004// RUN: %clang -### -c -save-temps -integrated-as -g %s 2>&1 \
5// RUN: | FileCheck -check-prefix=SAVE %s
NAKAMURA Takumi5a5bb932012-01-12 06:15:01 +00006//
Douglas Katzman3459ce22015-10-08 04:24:12 +00007// SAVE: "-cc1"{{.*}}"-E"{{.*}}"-debug-info-kind=
8// SAVE: "-cc1"{{.*}}"-emit-llvm-bc"{{.*}}"-debug-info-kind=
9// SAVE: "-cc1"{{.*}}"-S"{{.*}}"-debug-info-kind=
NAKAMURA Takumi5a5bb932012-01-12 06:15:01 +000010// SAVE: "-cc1as"
Douglas Katzman3459ce22015-10-08 04:24:12 +000011// SAVE-NOT: -debug-info-kind=
NAKAMURA Takumi5a5bb932012-01-12 06:15:01 +000012
Douglas Katzman9a2ef282015-09-30 15:55:59 +000013// Make sure that '-ggdb0' is not accidentally mistaken for '-g'
14// RUN: %clang -### -ggdb0 -c -integrated-as -x assembler %s 2>&1 \
15// RUN: | FileCheck -check-prefix=GGDB0 %s
16//
17// GGDB0: "-cc1as"
Douglas Katzman3459ce22015-10-08 04:24:12 +000018// GGDB0-NOT: -debug-info-kind=
Douglas Katzman9a2ef282015-09-30 15:55:59 +000019
NAKAMURA Takumi84a5dfd2011-12-31 02:36:23 +000020// Check to make sure clang with -g on a .s file gets passed.
21// rdar://9275556
Douglas Katzman9a2ef282015-09-30 15:55:59 +000022// RUN: %clang -### -c -integrated-as -g -x assembler %s 2>&1 \
NAKAMURA Takumif8f4c952012-12-11 07:16:15 +000023// RUN: | FileCheck %s
NAKAMURA Takumi84a5dfd2011-12-31 02:36:23 +000024//
NAKAMURA Takumif8f4c952012-12-11 07:16:15 +000025// CHECK: "-cc1as"
Douglas Katzman3459ce22015-10-08 04:24:12 +000026// CHECK: "-debug-info-kind=limited"
Kevin Enderbyae2ec472013-01-17 21:38:06 +000027
28// Check to make sure clang with -g on a .s file gets passed -dwarf-debug-producer.
29// rdar://12955296
Douglas Katzman9a2ef282015-09-30 15:55:59 +000030// RUN: %clang -### -c -integrated-as -g -x assembler %s 2>&1 \
Kevin Enderbyae2ec472013-01-17 21:38:06 +000031// RUN: | FileCheck -check-prefix=P %s
32//
33// P: "-cc1as"
34// P: "-dwarf-debug-producer"