Files
swift-mirror/test/IRGen/lazy_multi_file.swift
Anthony Latsis b5aec4cc34 [test] Remove pre-rebranch nocapture matches
These were added in https://github.com/swiftlang/swift/pull/81375 (and
several other follow-up PRs because we missed a few places) and
are no longer needed.
2025-10-24 02:07:22 +01:00

30 lines
1.2 KiB
Swift

// RUN: %target-swift-frontend -primary-file %s %S/Inputs/lazy_multi_file_helper.swift -emit-ir | %FileCheck %s
// RUN: %target-swift-frontend -primary-file %s %S/Inputs/lazy_multi_file_helper.swift -emit-ir
// REQUIRES: CPU=i386 || CPU=x86_64
// CHECK: %T15lazy_multi_file8SubclassC = type <{ %swift.refcounted, %[[OPTIONAL_INT_TY:TSiSg]], [{{[0-9]+}} x i8], %TSS }>
// CHECK: %[[OPTIONAL_INT_TY]] = type <{ [{{[0-9]+}} x i8], [1 x i8] }>
// CHECK: %T15lazy_multi_file13LazyContainerV = type <{ %[[OPTIONAL_INT_TY]] }>
class Subclass : LazyContainerClass {
final var str = "abc"
// FIXME(TODO: JIRA): i386 String grew beyond 3 words, so we have to allow
// an indirect return value. When it shrinks back, remove the optional
// indirect out.
//
// CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias sret captures\(none\), )?}}ptr swiftself %0) {{.*}} {
func getStr() -> String {
// CHECK: = getelementptr inbounds{{.*}} %T15lazy_multi_file8SubclassC, ptr %0, i32 0, i32 3
return str
}
}
// CHECK-LABEL: @"$s15lazy_multi_file4testSiyF"() {{.*}} {
func test() -> Int {
var container = LazyContainer()
useLazyContainer(container)
return container.lazyVar
}