mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test][wasm] Add test to kill the missing func addr reservation
This commit is contained in:
@@ -745,3 +745,45 @@ func reproduction<T: Init>(_ x: Int, _ y: Int, _ t: T) {
|
||||
|
||||
// CHECK: there is no byte
|
||||
reproduction(2, 3, TrailingByte())
|
||||
|
||||
do {
|
||||
// regression test for https://github.com/swiftlang/swift-driver/pull/1987
|
||||
@inline(never) func blackhole<T>(_ t: T) { }
|
||||
|
||||
final class Context {
|
||||
func doSomething() {}
|
||||
deinit {
|
||||
print("Context deinit")
|
||||
}
|
||||
}
|
||||
|
||||
enum MyOptional<Value> {
|
||||
case some(Value)
|
||||
case none
|
||||
}
|
||||
|
||||
final class _GenericStorage<Value> {
|
||||
let value: MyOptional<Value>
|
||||
|
||||
init(value: Value) {
|
||||
self.value = .some(value)
|
||||
}
|
||||
|
||||
func unwrapAndCopy() {
|
||||
if case .some(let value) = value {
|
||||
blackhole(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let test = _GenericStorage(
|
||||
value: Context().doSomething,
|
||||
)
|
||||
// CHECK: test.unwrapAndCopy
|
||||
print("test.unwrapAndCopy")
|
||||
test.unwrapAndCopy()
|
||||
// CHECK: test.unwrapAndCopy
|
||||
print("test.unwrapAndCopy")
|
||||
test.unwrapAndCopy()
|
||||
// CHECK: Context deinit
|
||||
}
|
||||
|
||||
@@ -191,7 +191,11 @@ class WasmStdlib(cmake_product.CMakeProduct):
|
||||
# Test configuration
|
||||
self.cmake_options.define('SWIFT_INCLUDE_TESTS:BOOL', 'TRUE')
|
||||
self.cmake_options.define('SWIFT_ENABLE_SOURCEKIT_TESTS:BOOL', 'FALSE')
|
||||
lit_test_paths = ['IRGen', 'stdlib', 'Concurrency/Runtime', 'embedded']
|
||||
lit_test_paths = [
|
||||
'IRGen', 'stdlib', 'Concurrency/Runtime', 'embedded',
|
||||
# TODO(katei): Enable all interpreter tests
|
||||
'Interpreter/enum.swift',
|
||||
]
|
||||
lit_test_paths = [os.path.join(
|
||||
self.build_dir, 'test-wasi-wasm32', path) for path in lit_test_paths]
|
||||
self.cmake_options.define('SWIFT_LIT_TEST_PATHS:STRING',
|
||||
|
||||
Reference in New Issue
Block a user