Files
swift-mirror/test/SILGen/const_param.swift
Xi Ge 1667c5f643 mangling: take the constness of function parameters into mangling
Taking constness of parameters into mangling allows us to support overloads of
functions vary on the constness of specific parameters.

rdar://87954644
2022-01-24 11:51:01 -08:00

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) -> ()