mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Taking constness of parameters into mangling allows us to support overloads of functions vary on the constness of specific parameters. rdar://87954644
16 lines
463 B
Swift
16 lines
463 B
Swift
// RUN: %target-swift-emit-silgen -parse-as-library %s -module-name A | %FileCheck %s
|
|
|
|
func foo(_ a: _const Int) {}
|
|
func bar(a: _const String) {}
|
|
|
|
// CHECK: @$s1A3fooyySiYtF
|
|
// CHECK: @$s1A3bar1aySSYt_tF
|
|
|
|
// RUN: %swift-demangle s1A3fooyySiYtF | %FileCheck %s -check-prefix=CHECK-FOO
|
|
|
|
// CHECK-FOO: A.foo(_const Swift.Int) -> ()
|
|
|
|
// RUN: %swift-demangle s1A3bar1aySSYt_tF | %FileCheck %s -check-prefix=CHECK-BAR
|
|
|
|
// CHECK-BAR: A.bar(a: _const Swift.String) -> ()
|