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

27 lines
830 B
Swift

// RUN: %target-swift-frontend -emit-ir -enable-experimental-feature Extern %s | %FileCheck %s
// REQUIRES: swift_feature_Extern
func test() {
// CHECK: call void @explicit_extern_c()
explicit_extern_c()
// CHECK: call void @implicit_extern_c()
implicit_extern_c()
// CHECK: [[DEFAULT_ARG:%[0-9]+]] = call swiftcc i32 @"$s8extern_c17default_arg_valueyys5Int32VFfA_"()
// CHECK: call void @default_arg_value(i32 [[DEFAULT_ARG]])
default_arg_value()
// CHECK: call void @default_arg_value(i32 24)
default_arg_value(24)
}
test()
// CHECK: declare void @explicit_extern_c()
@_extern(c, "explicit_extern_c") func explicit_extern_c()
// CHECK: declare void @implicit_extern_c()
@_extern(c) func implicit_extern_c()
// CHECK: declare void @default_arg_value(i32)
@_extern(c) func default_arg_value(_: Int32 = 42)