diff options
| author | Francis Ricci <francisjricci@gmail.com> | 2017-10-05 20:03:01 +0000 |
|---|---|---|
| committer | Francis Ricci <francisjricci@gmail.com> | 2017-10-05 20:03:01 +0000 |
| commit | 2b513b5c996c7ada1a5826d097cfde563bd5ca99 (patch) | |
| tree | f72242571d95e8f80e5f135a7b50e971fa19a5ff /llvm/test | |
| parent | 7ae3ae9ef4cf3a427078bbb9f8ca4b4d0080569c (diff) | |
| download | bcm5719-llvm-2b513b5c996c7ada1a5826d097cfde563bd5ca99.tar.gz bcm5719-llvm-2b513b5c996c7ada1a5826d097cfde563bd5ca99.zip | |
[llvm-dsymutil] Add support for __swift_ast MachO DWARF section
Summary:
Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging,
and which contains a byte-for-byte dump of the swiftmodule file.
Add this feature to llvm-dsymutil.
Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of
`__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil
(Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the
__swift_ast section).
Reviewers: aprantl, friss
Subscribers: llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D38504
llvm-svn: 315014
Diffstat (limited to 'llvm/test')
| -rwxr-xr-x | llvm/test/tools/dsymutil/Inputs/swift-ast.macho.x86_64 | bin | 0 -> 8464 bytes | |||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/swift-ast.swiftmodule | 1 | ||||
| -rw-r--r-- | llvm/test/tools/dsymutil/swift-ast.test | 14 |
3 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/tools/dsymutil/Inputs/swift-ast.macho.x86_64 b/llvm/test/tools/dsymutil/Inputs/swift-ast.macho.x86_64 Binary files differnew file mode 100755 index 00000000000..f82d811409b --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/swift-ast.macho.x86_64 diff --git a/llvm/test/tools/dsymutil/Inputs/swift-ast.swiftmodule b/llvm/test/tools/dsymutil/Inputs/swift-ast.swiftmodule new file mode 100644 index 00000000000..b9f59495119 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/swift-ast.swiftmodule @@ -0,0 +1 @@ +SWIFTMODULE DATA diff --git a/llvm/test/tools/dsymutil/swift-ast.test b/llvm/test/tools/dsymutil/swift-ast.test new file mode 100644 index 00000000000..d6fd7af1113 --- /dev/null +++ b/llvm/test/tools/dsymutil/swift-ast.test @@ -0,0 +1,14 @@ +RUN: llvm-dsymutil -oso-prepend-path %p %p/Inputs/swift-ast.macho.x86_64 -o %T/swift-ast.dSYM -verbose | FileCheck %s --check-prefix=DSYMUTIL +RUN: llvm-readobj -sections -section-data %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast | FileCheck %s --check-prefix=READOBJ + +The tested object file has been created by the dummy Swift code: +let x = 1 + +Compiled with: swiftc /tmp/test.swift -Onone -target x86_64-apple-macosx10.9 -c +Linked with: ld swift-ast.o -add_ast_path Inputs/swift-ast.swiftmodule -arch x86_64 -lSystem -macosx_version_min 10.9.0 + +DSYMUTIL: filename:{{.*}}swift-ast.swiftmodule +DSYMUTIL: DEBUG MAP OBJECT:{{.*}}swift-ast.swiftmodule + +READOBJ: Name:{{.*}}__swift_ast +READOBJ: |SWIFTMODULE DATA| |

