diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-10-17 19:36:18 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-10-17 19:36:18 +0000 |
commit | d50d56c774c37df460f5c4f1f33c48d4bb326545 (patch) | |
tree | 3ecd2a7cca483ca7eaac0508a330af94c081479e /clang/test/Driver/debug-options.c | |
parent | 018a3afa99573586646e36d6e3e20e59975466bb (diff) | |
download | bcm5719-llvm-d50d56c774c37df460f5c4f1f33c48d4bb326545.tar.gz bcm5719-llvm-d50d56c774c37df460f5c4f1f33c48d4bb326545.zip |
Driver/Darwin: Set the DWARF version based on the deployment target.
System utilities such as atos only support DWARF 4 on OS X 10.11+ and
iOS 9+. We thus want to enable DWARF 4 only if the deployment target
has a recent enough operating system version and use DWARF 2 for older
systems.
<rdar://problem/28766743>
llvm-svn: 284416
Diffstat (limited to 'clang/test/Driver/debug-options.c')
-rw-r--r-- | clang/test/Driver/debug-options.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c index 0702811ae84..ec21bfe3dae 100644 --- a/clang/test/Driver/debug-options.c +++ b/clang/test/Driver/debug-options.c @@ -19,17 +19,31 @@ // RUN: | FileCheck -check-prefix=G -check-prefix=G_SCE %s // RUN: %clang -### -c -g %s -target x86_64-apple-darwin 2>&1 \ -// RUN: | FileCheck -check-prefix=G_DARWIN -check-prefix=G_LLDB %s -// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin 2>&1 \ -// RUN: | FileCheck -check-prefix=G_DARWIN %s -// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin 2>&1 \ -// RUN: | FileCheck -check-prefix=G_DARWIN %s -// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin 2>&1 \ -// RUN: | FileCheck -check-prefix=G_DARWIN -check-prefix=G_GDB %s -// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 -check-prefix=G_LLDB %s +// RUN: %clang -### -c -g %s -target x86_64-apple-darwin16 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 -check-prefix=G_LLDB %s +// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin16 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s +// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin16 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s +// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin16 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 -check-prefix=G_GDB %s +// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin16 2>&1 \ // RUN: | FileCheck -check-prefix=GLTO_ONLY %s -// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin 2>&1 \ -// RUN: | FileCheck -check-prefix=G_DARWIN %s +// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin16 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s +// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.11 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s +// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.10 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -g %s -target armv7-apple-ios9.0 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s +// RUN: %clang -### -c -g %s -target armv7-apple-ios8.0 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -g %s -target armv7k-apple-watchos 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s +// RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s // RUN: %clang -### -c -g %s -target x86_64-pc-freebsd10.0 2>&1 \ // RUN: | FileCheck -check-prefix=G_GDB %s @@ -75,7 +89,7 @@ // RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \ // RUN: | FileCheck -check-prefix=G_ONLY %s -// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin 2>&1 \ +// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin16 2>&1 \ // RUN: | FileCheck -check-prefix=G_STANDALONE_DWARF4 %s // RUN: %clang -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \ // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s @@ -121,9 +135,6 @@ // G: "-cc1" // G: "-debug-info-kind=limited" // -// G_DARWIN: "-cc1" -// G_DARWIN: "-dwarf-version=4" -// // NOG_PS4: "-cc1" // NOG_PS4-NOT "-dwarf-version= // NOG_PS4: "-generate-arange-section" @@ -151,10 +162,6 @@ // G_ONLY: "-cc1" // G_ONLY: "-debug-info-kind=limited" // -// G_GDB: "-debugger-tuning=gdb" -// G_LLDB: "-debugger-tuning=lldb" -// G_SCE: "-debugger-tuning=sce" -// // These tests assert that "-gline-tables-only" "-g" uses the latter, // but otherwise not caring about the DebugInfoKind. // G_ONLY_DWARF2: "-cc1" @@ -165,6 +172,10 @@ // G_STANDALONE_DWARF4: "-debug-info-kind=standalone" // G_STANDALONE_DWARF4: "-dwarf-version=4" // +// G_GDB: "-debugger-tuning=gdb" +// G_LLDB: "-debugger-tuning=lldb" +// G_SCE: "-debugger-tuning=sce" +// // This tests asserts that "-gline-tables-only" "-g0" disables debug info. // GLTO_NO: "-cc1" // GLTO_NO-NOT: -debug-info-kind= |