Skip to content

Commit

Permalink
Repro for an invalid .swiftinterface generated when textually includi…
Browse files Browse the repository at this point in the history
…ng a C

struct in different modules.

The newly added test fails.
  • Loading branch information
martinboehme committed Jun 17, 2020
1 parent d45047d commit f431f1b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/Interop/C/modules/Inputs/MainModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import SubModule

public func funcTakingForeignStruct(_ param: ForeignStruct) {}
2 changes: 2 additions & 0 deletions test/Interop/C/modules/Inputs/SubModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import ForeignA
@_exported import ForeignB
1 change: 1 addition & 0 deletions test/Interop/C/modules/Inputs/foreign-a.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "textual-header.h"
1 change: 1 addition & 0 deletions test/Interop/C/modules/Inputs/foreign-b.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "textual-header.h"
7 changes: 7 additions & 0 deletions test/Interop/C/modules/Inputs/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module ForeignA {
header "foreign-a.h"
}

module ForeignB {
header "foreign-b.h"
}
1 change: 1 addition & 0 deletions test/Interop/C/modules/Inputs/textual-header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
struct ForeignStruct {};
5 changes: 5 additions & 0 deletions test/Interop/C/modules/repro.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: mkdir %t/sub_module %t/main_module
// RUN: %target-swift-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/sub_module/SubModule.swiftmodule %S/Inputs/SubModule.swift -I %S/Inputs
// RUN: %target-swift-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/main_module/MainModule.swiftmodule -emit-module-interface-path %t/main_module/MainModule.swiftinterface -I %t/sub_module %S/Inputs/MainModule.swift -I %S/Inputs
// RUN: %target-swift-frontend -typecheck -swift-version 5 %t/main_module/MainModule.swiftinterface -I %t/sub_module -I %S/Inputs

0 comments on commit f431f1b

Please sign in to comment.