Skip to content

Commit 28ba2d8

Browse files
committed
[cxx-interop][nfc] Add a test case for linker error.
1 parent 6868ae2 commit 28ba2d8

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
extern "C" {
2+
3+
inline void inlineFn();
4+
5+
void cacheMis() { }
6+
void incorrectCacheHit() {
7+
inlineFn();
8+
}
9+
10+
static void caller() {
11+
cacheMis();
12+
incorrectCacheHit();
13+
}
14+
15+
inline void inlineFn() { }
16+
17+
}
18+

test/Interop/Cxx/extern-c/Inputs/module.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ module ExternC {
22
header "extern-c.h"
33
requires cplusplus
44
}
5+
6+
module InlineFunc {
7+
header "inline-func.h"
8+
requires cplusplus
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop)
2+
// REQUIRES: executable_test
3+
4+
import InlineFunc
5+
6+
public func test() {
7+
caller()
8+
}

0 commit comments

Comments
 (0)