Skip to content

Commit 07a1f56

Browse files
committed
[interop] add target-interop-clangxx test expansion to build C++ file with /MD msvc mode
1 parent 846fdb5 commit 07a1f56

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

test/Interop/SwiftToCxx/functions/cdecl-execution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// RUN: %target-swift-frontend %S/cdecl.swift -typecheck -module-name CdeclFunctions -emit-cxx-header-path %t/functions.h
44

5-
// RUN: %target-clangxx -c %s -I %t -o %t/cdecl-execution.o
5+
// RUN: %target-interop-clangxx -c %s -I %t -o %t/cdecl-execution.o
66
// RUN: %target-build-swift-link-cxx %S/cdecl.swift -o %t/cdecl-execution -Xlinker %t/cdecl-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain
77

88
// RUN: %target-codesign %t/cdecl-execution

test/Interop/SwiftToCxx/functions/swift-functions-execution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// RUN: %target-swift-frontend %S/swift-functions.swift -typecheck -module-name Functions -emit-cxx-header-path %t/functions.h
44

5-
// RUN: %target-clangxx -c %s -I %t -o %t/swift-functions-execution.o
5+
// RUN: %target-interop-clangxx -c %s -I %t -o %t/swift-functions-execution.o
66
// RUN: %target-build-swift-link-cxx %S/swift-functions.swift -o %t/swift-functions-execution -Xlinker %t/swift-functions-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain
77

88
// RUN: %target-codesign %t/swift-functions-execution

test/Interop/lit.local.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ def get_target_os():
77
return run_os
88

99
libc_opt = ''
10+
clang_opt = ''
11+
1012
if get_target_os() in ['windows-msvc']:
1113
config.substitutions.insert(0, ('%target-abi', 'WIN'))
12-
libc_opt = '-libc MT '
14+
#libc_opt = '-libc MT '
15+
clang_opt = '-D_MT -D_DLL -Xclang --dependent-lib=msvcrt -Xclang --dependent-lib=oldnames '
1316
else:
1417
# FIXME(compnerd) do all the targets we currently support use SysV ABI?
1518
config.substitutions.insert(0, ('%target-abi', 'SYSV'))
1619

1720
config.substitutions.insert(0, ('%target-build-swift-link-cxx', '%target-build-swift -Xfrontend -enable-cxx-interop ' + libc_opt))
21+
22+
config.substitutions.insert(0, ('%target-interop-clangxx', '%target-clangxx ' + clang_opt))

0 commit comments

Comments
 (0)