Files
swift-mirror/test/IRGen/section_bridging_header.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

25 lines
669 B
Swift

// RUN: %empty-directory(%t)
// RUN: %{python} %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend -enable-experimental-feature SymbolLinkageMarkers -enforce-exclusivity=unchecked -parse-as-library -emit-sil -import-objc-header %t/bridge.h %t/file.swift -o /dev/null
// REQUIRES: swift_in_compiler
// REQUIRES: swift_feature_SymbolLinkageMarkers
// BEGIN bridge.h
struct MyStruct1 {
int x;
void (*fptr1)();
void (*fptr2)(int);
void (*fptr3)(int, char, void *);
};
// BEGIN file.swift
func foo() { }
@_section("__TEXT,__mysection") var my_global1 = MyStruct1(
x: 42,
fptr1: foo,
fptr2: nil,
fptr3: { arg1, arg2, arg3 in print(arg1, arg2, arg3) }
)