Files
swift-mirror/test/IRGen/generic_ternary.swift
Alex Lorenz 4858cb6225 [IRGen][interop] do not add 'nocapture' to not bitwise takable types
The use of 'nocapture' for parameters and return values is incorrect for C++ types, as they can actually capture a pointer into its own value (e.g. std::string in libstdc++)

rdar://115062687
2023-09-25 17:43:34 -07:00

14 lines
508 B
Swift

// RUN: %target-swift-frontend -primary-file %s -emit-ir | %FileCheck %s
// REQUIRES: CPU=i386 || CPU=x86_64
// <rdar://problem/13793646>
struct OptionalStreamAdaptor<T : IteratorProtocol> {
// CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor<T>", ptr nocapture swiftself dereferenceable({{.*}}) %1)
mutating
func next() -> Optional<T.Element> {
return x[0].next()
}
var x: [T]
}