mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Both the syntax and relative order of the LLVM `nocapture` parameter attribute changed upstream in 29441e4f5fa5f5c7709f7cf180815ba97f611297. To reduce conflicts with rebranch, adjust FileCheck patterns to expect both syntaxes and orders anywhere the presence of the attribute is not critical to the test. These changes are temporary and will be cleaned up once rebranch is merged into main.
30 lines
1.2 KiB
Swift
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( nocapture)? 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
|
|
}
|