Revision ac4b68fbf45853ba4b9e327cb42f93f42a8fa252 authored by Ellie Shin on 17 March 2023, 04:14:20 UTC, committed by Ellie Shin on 17 March 2023, 04:14:20 UTC
1 parent f2c68fb
Raw File
LoadableByAddress.swift
// RUN: %target-swift-frontend %s -module-name A -emit-ir -g -o - | %FileCheck %s
// REQUIRES: CPU=x86_64
public struct Continuation<A> {
   private let magicToken = "Hello World"
   fileprivate let f: (() -> A)?

   private let _makeMeBigger = 0

  public func run() {}
}

public typealias ContinuationU = Continuation<()>

// CHECK: %2 = alloca %T1A12ContinuationV, align 8
// CHECK-NEXT: call void @llvm.dbg.declare(metadata %T1A12ContinuationV* %2,
// CHECK-SAME:    metadata ![[X:.*]], metadata !DIExpression())
// CHECK: ![[X]] = !DILocalVariable(name: "x",

public func f<A>(_ xs: [Continuation<A>]) -> (() -> A?) {
   return {
       for x in xs {
           x.run()
       }
       return nil
   }
}

back to top