diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2017-10-11 13:34:52 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2017-10-11 13:34:52 +0000 |
| commit | 8acb2e3ac40982acb49b894972b11f00ed72598c (patch) | |
| tree | f234a9ed6a1f3664a309ec02cfb85cb451423176 /llvm/test/tools | |
| parent | 5c1eef461856944ae776badc3c123e2bef2a0697 (diff) | |
| download | bcm5719-llvm-8acb2e3ac40982acb49b894972b11f00ed72598c.tar.gz bcm5719-llvm-8acb2e3ac40982acb49b894972b11f00ed72598c.zip | |
[dsymutil] Timestmap verification for __swift_ast
This patch adds timestamp verification for swiftmodule files.
- A new flag is provided to allows us to continue testing of the code
for embedding the__swift_ast. (git doesn't maintain timestamps)
- Adds a new test for fat (arm) binaries.
Differential revision: https://reviews.llvm.org/D38686
llvm-svn: 315456
Diffstat (limited to 'llvm/test/tools')
| -rw-r--r-- | llvm/test/tools/dsymutil/ARM/swift-ast.test | 26 | ||||
| -rwxr-xr-x | llvm/test/tools/dsymutil/Inputs/swift-ast.macho.fat | bin | 0 -> 131312 bytes | |||
| -rw-r--r-- | llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test | 11 |
3 files changed, 34 insertions, 3 deletions
diff --git a/llvm/test/tools/dsymutil/ARM/swift-ast.test b/llvm/test/tools/dsymutil/ARM/swift-ast.test new file mode 100644 index 00000000000..bd33e7af436 --- /dev/null +++ b/llvm/test/tools/dsymutil/ARM/swift-ast.test @@ -0,0 +1,26 @@ +RUN: llvm-dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.fat -o %T/swift-ast.dSYM -verbose -no-swiftmodule-timestamp | FileCheck %s --check-prefix=DSYMUTIL +RUN: llvm-readobj -sections -section-data %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.fat | 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 armv7-apple-ios8.1 -c -o swift-ast-armv7.o + ld swift-ast-armv7.o -add_ast_path swift-ast.swiftmodule -arch armv7 -ios_version_min 8.1 -syslibroot /path/to/iPhoneOS.sdk -L/path/to/usr/lib/swift/iphoneos -lobjc -lSystem -o swift-ast.macho.armv7 + + swiftc /tmp/test.swift -Onone -target arm64-apple-ios8.1 -c -o swift-ast-arm64.o + ld swift-ast-arm64.o -add_ast_path swift-ast.swiftmodule -arch arm64 -ios_version_min 8.1 -syslibroot /path/to/iPhoneOS.sdk -L/path/to/usr/lib/swift/iphoneos -lobjc -lSystem -o swift-ast.macho.arm64 + + lipo -create swift-ast.macho.armv7 swift-ast.macho.arm64 -o swift-ast.macho.fat + +DSYMUTIL: filename:{{.*}}swift-ast.swiftmodule +DSYMUTIL: DEBUG MAP OBJECT:{{.*}}swift-ast.swiftmodule + +READOBJ: Name:{{.*}}__swift_ast +READOBJ: |SWIFTMODULE DATA| +READOBJ-NEXT: |.| +READOBJ: |SWIFTMODULE DATA| +READOBJ-NEXT: |.| + +RUN: llvm-dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.fat -no-output -verbose 2>&1 | FileCheck %s --check-prefix=TIMESTAMP +TIMESTAMP: Warning: Timestamp mismatch diff --git a/llvm/test/tools/dsymutil/Inputs/swift-ast.macho.fat b/llvm/test/tools/dsymutil/Inputs/swift-ast.macho.fat Binary files differnew file mode 100755 index 00000000000..a3f8d369d02 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/swift-ast.macho.fat diff --git a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test index 72fc7520b73..98d3850efb0 100644 --- a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test +++ b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test @@ -1,14 +1,19 @@ -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-dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -o %T/swift-ast.dSYM -verbose -no-swiftmodule-timestamp | FileCheck %s --check-prefix=DSYMUTIL RUN: llvm-readobj -sections -section-data %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | 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 +Compiled with: + swiftc /tmp/test.swift -Onone -target x86_64-apple-macosx10.9 -c + 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| +READOBJ-NEXT: |.| + +RUN: llvm-dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -no-output -verbose 2>&1 | FileCheck %s --check-prefix=TIMESTAMP +TIMESTAMP: Warning: Timestamp mismatch |

