Skip to content

Commit 1f7bfed

Browse files
Merge pull request #451 from kateinoigakukun/katei/fix-test-part4
Fix test part 4
2 parents c32c3b0 + c74876a commit 1f7bfed

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ namespace {
711711
}
712712

713713
static const llvm::StringLiteral vaListNames[] = {
714-
"va_list", "__gnuc_va_list", "__va_list"
714+
"va_list", "__gnuc_va_list", "__isoc_va_list", "__va_list"
715715
};
716716

717717
ImportHint hint = ImportHint::None;

lib/ClangImporter/MappedTypes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ MAP_STDLIB_TYPE("u_int64_t", UnsignedInt, 64, "UInt64", false, DoNothing)
128128
// There's an explicit workaround in ImportType.cpp's VisitDecayedType for that.
129129
MAP_STDLIB_TYPE("va_list", VaList, 0, "CVaListPointer", false, DoNothing)
130130
MAP_STDLIB_TYPE("__gnuc_va_list", VaList, 0, "CVaListPointer", false, DoNothing)
131+
MAP_STDLIB_TYPE("__isoc_va_list", VaList, 0, "CVaListPointer", false, DoNothing)
131132
MAP_STDLIB_TYPE("__va_list", VaList, 0, "CVaListPointer", false, DoNothing)
132133

133134
// libkern/OSTypes.h types.

stdlib/public/core/VarArgs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ final internal class __VaListBuilder {
565565
// supported vararg type is greater than the alignment of Int, such
566566
// as non-iOS ARM. Note that we can't use alignof because it
567567
// differs from ABI alignment on some architectures.
568-
#if arch(arm) && !os(iOS)
568+
#if (arch(arm) && !os(iOS)) || arch(wasm32)
569569
if let arg = arg as? _CVarArgAligned {
570570
let alignmentInWords = arg._cVarArgAlignment / MemoryLayout<Int>.size
571571
let misalignmentInWords = count % alignmentInWords

test/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ elif run_os == 'wasi':
13821382
config.swift_test_options, config.swift_frontend_test_options)
13831383
subst_target_swift_frontend_mock_sdk = config.target_swift_frontend
13841384
subst_target_swift_frontend_mock_sdk_after = ""
1385-
config.target_run = 'wasmtime --'
1385+
config.target_run = 'wasmer run --backend cranelift --'
13861386
if 'interpret' in lit_config.params:
13871387
use_interpreter_for_simple_runs()
13881388
config.target_sil_opt = (

test/stdlib/Error.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ ErrorTests.test("default domain and code") {
105105

106106
enum SillyError: Error { case JazzHands }
107107

108+
#if !os(WASI)
108109
ErrorTests.test("try!")
109110
.skip(.custom({ _isFastAssertConfiguration() },
110111
reason: "trap is not guaranteed to happen in -Ounchecked"))
@@ -127,6 +128,7 @@ ErrorTests.test("try!/location")
127128
expectCrashLater()
128129
let _: () = try! { throw SillyError.JazzHands }()
129130
}
131+
#endif
130132

131133
ErrorTests.test("try?") {
132134
var value = try? { () throws -> Int in return 1 }()
@@ -191,6 +193,7 @@ ErrorTests.test("test dealloc empty error box") {
191193
}
192194
}
193195

196+
#if !os(WASI)
194197
var errors: [Error] = []
195198
ErrorTests.test("willThrow") {
196199
if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
@@ -215,6 +218,7 @@ ErrorTests.test("willThrow") {
215218
expectEqual(SillyError.self, type(of: errors.last!))
216219
}
217220
}
221+
#endif
218222

219223
runAllTests()
220224

test/stdlib/FlatMapDeprecation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swift -swift-version 4 -typecheck -verify %s
1+
// RUN: %target-typecheck-verify-swift -swift-version 4
22

33
func flatMapOnSequence<
44
S : Sequence

test/stdlib/InputStream.swift.gyb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// -*- swift -*-
1313
// RUN: %target-run-simple-swiftgyb
1414
// REQUIRES: executable_test
15+
// UNSUPPORTED: OS=wasi
1516

1617
import StdlibUnittest
1718

test/stdlib/Mirror.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ mirrors.test("Addressing") {
957957
expectNil(m.descendant(1, 1, "bork"))
958958
}
959959

960+
#if !os(WASI)
960961
mirrors.test("Invalid Path Type")
961962
.skip(.custom(
962963
{ _isFastAssertConfiguration() },
@@ -968,6 +969,7 @@ mirrors.test("Invalid Path Type")
968969
expectCrashLater()
969970
_ = m.descendant(X())
970971
}
972+
#endif
971973

972974
mirrors.test("PlaygroundQuickLook") {
973975
// Customization works.

test/stdlib/Runtime.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ Reflection.test("multiprotocolTypes") {
706706
var BitTwiddlingTestSuite = TestSuite("BitTwiddling")
707707

708708
BitTwiddlingTestSuite.test("_pointerSize") {
709-
#if arch(i386) || arch(arm)
709+
#if arch(i386) || arch(arm) || arch(wasm32)
710710
expectEqual(4, MemoryLayout<Optional<AnyObject>>.size)
711711
#elseif arch(x86_64) || arch(arm64) || arch(powerpc64) || arch(powerpc64le) || arch(s390x)
712712
expectEqual(8, MemoryLayout<Optional<AnyObject>>.size)
@@ -730,7 +730,7 @@ BitTwiddlingTestSuite.test("_isPowerOf2/Int") {
730730
expectTrue(_isPowerOf2(asInt(2)))
731731
expectFalse(_isPowerOf2(asInt(3)))
732732
expectTrue(_isPowerOf2(asInt(1024)))
733-
#if arch(i386) || arch(arm)
733+
#if arch(i386) || arch(arm) || arch(wasm32)
734734
// Not applicable to 32-bit architectures.
735735
#elseif arch(x86_64) || arch(arm64) || arch(powerpc64) || arch(powerpc64le) || arch(s390x)
736736
expectTrue(_isPowerOf2(asInt(0x8000_0000)))

test/stdlib/StringAPI.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ StringTests.test("SameTypeComparisons") {
319319
expectFalse(xs != xs)
320320
}
321321

322+
#if !os(WASI)
322323
StringTests.test("CompareStringsWithUnpairedSurrogates")
323324
.xfail(
324325
.always("<rdar://problem/18029104> Strings referring to underlying " +
@@ -334,6 +335,7 @@ StringTests.test("CompareStringsWithUnpairedSurrogates")
334335
]
335336
)
336337
}
338+
#endif
337339

338340
StringTests.test("[String].joined() -> String") {
339341
let s = ["hello", "world"].joined()

0 commit comments

Comments
 (0)