blob: a26fb29652b47fa6ec209c644170a6d91207510b [file] [log] [blame]
Dmitri Gribenko9eaae742013-01-28 17:30:37 +00001// RUN: %clang -### -S %s 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
Manman Ren825e8e412013-07-03 20:45:07 +00002// RUN: %clang -### -S %s -g -target x86_64-linux-gnu 2>&1 \
3// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s
Douglas Katzman3459ce22015-10-08 04:24:12 +00004
5// Assert that the toolchains which should default to a lower Dwarf version do so.
Manman Ren825e8e412013-07-03 20:45:07 +00006// RUN: %clang -### -S %s -g -target x86_64-apple-darwin 2>&1 \
Adrian Prantld50d56c2016-10-17 19:36:18 +00007// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
Brad Smith378e7f9b2014-06-13 03:35:37 +00008// RUN: %clang -### -S %s -g -target i686-pc-openbsd 2>&1 \
9// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
10// RUN: %clang -### -S %s -g -target x86_64-pc-freebsd10.0 2>&1 \
11// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
Douglas Katzman3459ce22015-10-08 04:24:12 +000012
13// 'g0' is the default. Just sanity-test that it does nothing
Dmitri Gribenko9eaae742013-01-28 17:30:37 +000014// RUN: %clang -### -S %s -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
Douglas Katzman3459ce22015-10-08 04:24:12 +000015
16// And check that the last of -g or -g0 wins.
Dmitri Gribenko9eaae742013-01-28 17:30:37 +000017// RUN: %clang -### -S %s -g -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
Douglas Katzman3459ce22015-10-08 04:24:12 +000018
19// These should be semantically the same as not having given 'g0' at all,
20// as the last 'g' option wins.
21//
Manman Ren825e8e412013-07-03 20:45:07 +000022// RUN: %clang -### -S %s -g0 -g -target x86_64-linux-gnu 2>&1 \
23// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s
24// RUN: %clang -### -S %s -g0 -g -target x86_64-apple-darwin 2>&1 \
Adrian Prantl432d3d22016-09-09 21:10:35 +000025// RUN: | FileCheck --check-prefix=CHECK-WITH-G-STANDALONE %s
Brad Smith378e7f9b2014-06-13 03:35:37 +000026// RUN: %clang -### -S %s -g0 -g -target i686-pc-openbsd 2>&1 \
27// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
Brad Smith6d1dfdc2014-06-13 03:53:07 +000028// RUN: %clang -### -S %s -g0 -g -target x86_64-pc-freebsd10.0 2>&1 \
Brad Smith378e7f9b2014-06-13 03:35:37 +000029// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
Alexander Eremin670c6272014-10-16 05:55:24 +000030// RUN: %clang -### -S %s -g0 -g -target i386-pc-solaris 2>&1 \
31// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
Dmitri Gribenko9eaae742013-01-28 17:30:37 +000032
Douglas Katzman3459ce22015-10-08 04:24:12 +000033// CHECK-WITHOUT-G-NOT: -debug-info-kind
34// CHECK-WITH-G: "-debug-info-kind=limited"
35// CHECK-WITH-G: "-dwarf-version=4"
36// CHECK-WITH-G-DWARF2: "-dwarf-version=2"
Adrian Prantl432d3d22016-09-09 21:10:35 +000037
38// CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"
Adrian Prantld50d56c2016-10-17 19:36:18 +000039// CHECK-WITH-G-STANDALONE: "-dwarf-version=2"