mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Find all the usages of `--enable-experimental-feature` or `--enable-upcoming-feature` in the tests and replace some of the `REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which should correctly apply to depending on the asserts/noasserts mode of the toolchain for each feature. Remove some comments that talked about enabling asserts since they don't apply anymore (but I might had miss some). All this was done with an automated script, so some formatting weirdness might happen, but I hope I fixed most of those. There might be some tests that were `REQUIRES: asserts` that might run in `noasserts` toolchains now. This will normally be because their feature went from experimental to upcoming/base and the tests were not updated.
42 lines
1.1 KiB
Swift
42 lines
1.1 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
// RUN: %swift-frontend -c %t/check.swift -parse-as-library -target wasm32-unknown-none-wasm \
|
|
// RUN: -enable-experimental-feature Embedded -Xcc -fdeclspec -disable-stack-protector \
|
|
// RUN: -o %t/check.o
|
|
// RUN: %clang -target wasm32-unknown-none-wasm %t/check.o %t/rt.c -nostdlib -o %t/check.wasm
|
|
// RUN: %target-run %t/check.wasm
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: CPU=wasm32
|
|
// REQUIRES: embedded_stdlib_cross_compiling
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
//--- rt.c
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
int putchar(int c) { return c; }
|
|
void free(void *ptr) {}
|
|
void *memmove(void *dest, const void *src, size_t n) {
|
|
return __builtin_memmove(dest, src, n);
|
|
}
|
|
|
|
int posix_memalign(void **memptr, size_t alignment, size_t size) {
|
|
uintptr_t mem = __builtin_wasm_memory_grow(0, (size + 0xffff) / 0x10000);
|
|
if (mem == -1) {
|
|
return -1;
|
|
}
|
|
*memptr = (void *)(mem * 0x10000);
|
|
*memptr = (void *)(((uintptr_t)*memptr + alignment - 1) & -alignment);
|
|
return 0;
|
|
}
|
|
|
|
//--- check.swift
|
|
|
|
class Foo {}
|
|
|
|
@_cdecl("_start")
|
|
func main() {
|
|
_ = Foo()
|
|
}
|