Skip to content

Commit 63f3ced

Browse files
committed
Disambiguate the reference to remquo on Windows
For #85606
1 parent 73fd67b commit 63f3ced

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

stdlib/public/Platform/tgmath.swift.gyb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ public func lgamma(_ x: ${T}) -> (${T}, Int) {
295295
@_transparent
296296
public func remquo(_ x: ${T}, _ y: ${T}) -> (${T}, Int) {
297297
var quo = Int32(0)
298+
#if !os(Windows)
298299
let rem = unsafe remquo${f}(${CT}(x), ${CT}(y), &quo)
300+
#else
301+
let rem = unsafe corecrt.remquo${f}(${CT}(x), ${CT}(y), &quo)
302+
#endif
299303
return (${T}(rem), Int(quo))
300304
}
301305
% if T == 'Float80':
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// REQUIRES: OS=windows-msvc
2+
3+
// Test building the CRT module with C++ interop enabled on Windows
4+
5+
// RUN: %empty-directory(%t)
6+
// RUN: split-file %s %t
7+
// RUN: %target-swift-frontend -scan-dependencies -module-name Test \
8+
// RUN: -module-cache-path %t/clang-module-cache -disable-objc-interop \
9+
// RUN: -cxx-interoperability-mode=default \
10+
// RUN: -parse-stdlib -module-load-mode prefer-serialized \
11+
// RUN: %t/Test.swift -o %t/deps.json -I %t 2>&1
12+
13+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:SAL > %t/SAL.cmd
14+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:vcruntime > %t/vcruntime.cmd
15+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/SwiftShims.cmd
16+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json Swift > %t/Swift.cmd
17+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:_Builtin_stddef > %t/_Builtin_stddef.cmd
18+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:corecrt > %t/corecrt.cmd
19+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:std_config > %t/std_config.cmd
20+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:_float > %t/_float.cmd
21+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:_fenv > %t/_fenv.cmd
22+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:_stdlib > %t/_stdlib.cmd
23+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:_malloc > %t/_malloc.cmd
24+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:_Builtin_intrinsics > %t/_Builtin_intrinsics.cmd
25+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:ucrt > %t/ucrt.cmd
26+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:std > %t/std.cmd
27+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:_complex > %t/_complex.cmd
28+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftOverlayShims > %t/SwiftOverlayShims.cmd
29+
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json CRT > %t/CRT.cmd
30+
31+
// Remove the candidate module file flag to force building from the swiftinterface file.
32+
// RUN: cat %t/CRT.cmd | sed '/candidate-module-file/d; /CRT.swiftmodule.*swiftmodule/d' > %t/CRT.mod.cmd
33+
34+
// RUN: %swift_frontend_plain @%t/SAL.cmd 2>&1
35+
// RUN: %swift_frontend_plain @%t/vcruntime.cmd 2>&1
36+
// RUN: %swift_frontend_plain @%t/SwiftShims.cmd 2>&1
37+
// RUN: %swift_frontend_plain @%t/Swift.cmd 2>&1
38+
// RUN: %swift_frontend_plain @%t/_Builtin_stddef.cmd 2>&1
39+
// RUN: %swift_frontend_plain @%t/corecrt.cmd 2>&1
40+
// RUN: %swift_frontend_plain @%t/std_config.cmd 2>&1
41+
// RUN: %swift_frontend_plain @%t/_float.cmd 2>&1
42+
// RUN: %swift_frontend_plain @%t/_fenv.cmd 2>&1
43+
// RUN: %swift_frontend_plain @%t/_stdlib.cmd 2>&1
44+
// RUN: %swift_frontend_plain @%t/_malloc.cmd 2>&1
45+
// RUN: %swift_frontend_plain @%t/_Builtin_intrinsics.cmd 2>&1
46+
// RUN: %swift_frontend_plain @%t/ucrt.cmd 2>&1
47+
// RUN: %swift_frontend_plain @%t/std.cmd 2>&1
48+
// RUN: %swift_frontend_plain @%t/_complex.cmd 2>&1
49+
// RUN: %swift_frontend_plain @%t/SwiftOverlayShims.cmd 2>&1
50+
// RUN: %swift_frontend_plain @%t/CRT.mod.cmd 2>&1
51+
52+
//--- Test.swift
53+
import CRT
54+

0 commit comments

Comments
 (0)