summaryrefslogtreecommitdiff
path: root/test/Driver
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-11-14 09:22:16 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-11-14 09:22:16 +0000
commita152c7a4b7ba8f4cb9532ead9a38a7121db43d50 (patch)
tree402c44e933300eb41500d17eaac3b356db56bf93 /test/Driver
parenta0421d1226c45dfd4508ed6b6ee81ffb8357198e (diff)
downloadclang-a152c7a4b7ba8f4cb9532ead9a38a7121db43d50.tar.gz
[Clang] - Add '-gsplit-dwarf[=split,=single]' version for '-gsplit-dwarf' option.
The DWARF5 specification says(Appendix F.1): "The sections that do not require relocation, however, can be written to the relocatable object (.o) file but ignored by the linker or they can be written to a separate DWARF object (.dwo) file that need not be accessed by the linker." The first part describes a single file split DWARF feature and there is no way to trigger this behavior atm. Fortunately, no many changes are required to keep *.dwo sections in a .o, the patch does that. Differential revision: https://reviews.llvm.org/D52296 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver')
-rw-r--r--test/Driver/split-debug.c15
-rw-r--r--test/Driver/split-debug.s7
2 files changed, 22 insertions, 0 deletions
diff --git a/test/Driver/split-debug.c b/test/Driver/split-debug.c
index 212c12f539..0ac206395e 100644
--- a/test/Driver/split-debug.c
+++ b/test/Driver/split-debug.c
@@ -5,6 +5,21 @@
//
// CHECK-ACTIONS: "-split-dwarf-file" "split-debug.dwo"
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-ACTIONS-SINGLE-SPLIT < %t %s
+//
+// CHECK-ACTIONS-SINGLE-SPLIT: "-enable-split-dwarf=single"
+// CHECK-ACTIONS-SINGLE-SPLIT: "-split-dwarf-file" "split-debug.o"
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### -o %tfoo.o %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-SINGLE-SPLIT-FILENAME < %t %s
+//
+// CHECK-SINGLE-SPLIT-FILENAME: "-split-dwarf-file" "{{.*}}foo.o"
// RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
diff --git a/test/Driver/split-debug.s b/test/Driver/split-debug.s
index 6e6f8c5b80..ece64cc0ad 100644
--- a/test/Driver/split-debug.s
+++ b/test/Driver/split-debug.s
@@ -5,6 +5,13 @@
//
// CHECK-ACTIONS: "-split-dwarf-file" "split-debug.dwo"
+// Check we pass -split-dwarf-file to `as` if -gsplit-dwarf=split.
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
+
+// Check we do not pass any -split-dwarf* commands to `as` if -gsplit-dwarf=single.
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
// RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s