Files
swift-mirror/test/DebugInfo/debug_prefix_map_sdk.swift
Keith Smiley 8e886ab2f9 Apply -debug-prefix-map to isysroot (#32580)
* Apply -debug-prefix-map to isysroot

Previously the absolute path to the sysroot, which could differ across
machines in remote build scenarios, was included in the debug info of
object files:

```
!11 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !12, producer: "Swift version 5.3-dev (LLVM 93caf26adb68d37, Swift 58b2ddc65afbd60)", isOptimized: false, runtimeVersion: 5, emissionKind: FullDebug, enums: !13, imports: !14, sysroot: "/Applications/Xcode-11.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk", sdk: "MacOSX.sdk")
```

With this change these are included in the remapping done by
`-debug-prefix-map`.

* Fix test
2020-07-01 00:40:30 -07:00

9 lines
411 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -sdk %t/SOME_SDK -g %s -emit-ir | %FileCheck -check-prefix=WITHOUT-PREFIX-MAP %s
// RUN: %target-swift-frontend -sdk %t/SOME_SDK -g %s -emit-ir -debug-prefix-map %t/SOME_SDK=foo | %FileCheck -check-prefix=WITH-PREFIX-MAP -implicit-check-not=SOME_SDK %s
func foo() {}
// WITHOUT-PREFIX-MAP: sysroot: "{{.*}}SOME_SDK
// WITH-PREFIX-MAP: sysroot: "foo