Files
swift-mirror/test/IRGen/existential-bitwise-borrowability.swift
Daniel Rodríguez Troitiño ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
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.
2024-11-02 11:46:46 -07:00

42 lines
1.7 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %{python} %utils/chex.py < %s > %t/existential-bitwise-borrowability.swift
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -enable-experimental-feature ValueGenerics -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift %t/existential-bitwise-borrowability.swift | %FileCheck %t/existential-bitwise-borrowability.swift --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
// REQUIRES: swift_feature_RawLayout
// REQUIRES: swift_feature_ValueGenerics
// Copyable existentials are bitwise-borrowable (because copyable types are
// always bitwise-borrowable if they're bitwise-takable, and only bitwise-takable
// values are stored inline in existentials). Noncopyable existentials are
// not (since types like Atomic and Mutex can be stored inline in their
// buffers).
// CHECK-LABEL: @"$s{{[A-Za-z0-9_]*}}3FooVWV" = {{.*}} %swift.vwtable
// size
// CHECK-64-SAME: , {{i64|i32}} 32
// CHECK-32-SAME: , {{i64|i32}} 16
// stride
// CHECK-64-SAME: , {{i64|i32}} 32
// CHECK-32-SAME: , {{i64|i32}} 16
// flags: word alignment, noncopyable, non-POD, non-inline-storage
// CHECK-64-SAME: , <i32 0x830007>
// CHECK-32-SAME: , <i32 0x830003>
struct Foo: ~Copyable {
var x: Any
}
// CHECK-LABEL: @"$s{{[A-Za-z0-9_]*}}3BarVWV" = {{.*}} %swift.vwtable
// size
// CHECK-64-SAME: , {{i64|i32}} 32
// CHECK-32-SAME: , {{i64|i32}} 16
// stride
// CHECK-64-SAME: , {{i64|i32}} 32
// CHECK-32-SAME: , {{i64|i32}} 16
// flags: word alignment, non-bitwise-borrowable, noncopyable, non-POD, non-inline-storage
// CHECK-64-SAME: , <i32 0x1830007>
// CHECK-32-SAME: , <i32 0x1830003>
struct Bar: ~Copyable {
var x: any ~Copyable
}