Module aliasing: use module real name to create DIModule

This commit is contained in:
elsh
2021-10-07 15:06:54 -07:00
parent b69eac9630
commit 317a766a80
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
// RUN: %empty-directory(%t)
/// Create a module Bar
// RUN: echo 'public class Klass {}' > %t/FileBar.swift
// RUN: %target-swift-frontend -module-name Bar %t/FileBar.swift -emit-module -emit-module-path %t/Bar.swiftmodule
// RUN: test -f %t/Bar.swiftmodule
/// Create a module Foo that imports Cat with -module-alias Cat=Bar
// RUN: %target-swift-frontend -emit-ir -module-name Foo -module-alias Cat=Bar %s -I %t -g -o - | %FileCheck %s
// CHECK-DAG: ![[BARMODULE:[0-9]+]] = !DIModule({{.*}}, name: "Bar"
// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE]], entity: ![[BARMODULE]]
import Cat
public func meow() -> Cat.Klass? { return nil }