Files
swift-mirror/test/embedded/internalize-no-stdlib.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

35 lines
1010 B
Swift

// This test checks that embedded Swift doesn't mark public functions/symbols as llvm.used / llvm.compiler.used
// RUN: %target-swift-emit-ir %s -parse-stdlib -enable-experimental-feature Embedded -target arm64e-apple-none-elf -wmo | %FileCheck %s --check-prefix CHECK-ELF
// RUN: %target-swift-emit-ir %s -parse-stdlib -enable-experimental-feature Embedded -target arm64e-apple-none-macho -wmo | %FileCheck %s --check-prefix CHECK-MACHO
// REQUIRES: swift_in_compiler
// REQUIRES: swift_feature_Embedded
struct Bool {}
protocol Player {
func play()
var canPlay: Bool { get }
}
struct Concrete : Player {
func play() { }
var canPlay: Bool { Bool() }
}
func start(p: some Player) {
p.play()
}
public func main() {
start(p: Concrete())
}
// CHECK-ELF: @_swift1_autolink_entries =
// CHECK-ELF: @llvm.used = appending global [1 x ptr] [ptr @_swift1_autolink_entries], section "llvm.metadata"
// CHECK-ELF-NOT: @llvm.used
// CHECK-MACHO-NOT: @llvm.compiler.used
// CHECK-MACHO-NOT: @llvm.used