- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathasync-let-await.swift
18 lines (15 loc) · 787 Bytes
/
async-let-await.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
// RUN: -module-name M -disable-availability-checking \
// RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
// REQUIRES: concurrency
publicfunc getVegetables()async->[String]{
return["leek","carrot"]
}
// CHECK: define {{.*}} @"$s1M14chopVegetablesSaySSGyYaKFTQ0_"
publicfunc chopVegetables()asyncthrows->[String]{
letveggies=awaitgetVegetables()
// CHECK-NOT: {{^define }}
// CHECK: call void @llvm.dbg.declare(metadata ptr %0, metadata ![[V:[0-9]+]], metadata !DIExpression(DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_plus_uconst, {{[0-9]+}})
// CHECK: ![[V]] = !DILocalVariable(name: "veggies"
return veggies.map{"chopped \($0)"}
}