Files
swift-mirror/test/SILOptimizer/performance-annotations2.swift
Erik Eckstein edb08dabd5 GenericSpecializer: fix the function convention if specialization removes the self parameter of a method
When dropping the self metatype parameter of a method, it must become a "thin" function.

Fixes a crash when using performance annotations.

rdar://107202455
2023-05-11 08:03:19 +02:00

21 lines
669 B
Swift

// RUN: %target-swift-frontend -experimental-performance-annotations %s -sil-verify-all -module-name=test -emit-sil | %FileCheck %s
// REQUIRES: swift_in_compiler,swift_stdlib_no_asserts,optimized_stdlib
// UNSUPPORTED: swift_test_mode_optimize
public struct Stack<T> {
var size = 42
}
// CHECK-LABEL: sil [no_allocation] @$s4test11createStackyyF :
// CHECK: [[F:%[0-9]+]] = function_ref @$s4test5StackVACyxGycfCSi_Tgm5
// CHECK: [[S:%[0-9]+]] = apply [[F]]()
// CHECK: debug_value [[S]]
// CHECK: } // end sil function '$s4test11createStackyyF'
@_noAllocation
public func createStack() {
let s = Stack<Int>()
_ = s.size
}