Repository: apple/swift
File: test/DebugInfo/async-args.swift (Swift)

Code before:
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
// RUN:    -module-name M  -target %target-swift-5.1-abi-triple \
// RUN:    -parse-as-library | %FileCheck %s

// REQUIRES: concurrency

func use<T>(_ t: T) {}
func forceSplit() async {
}
func withGenericArg<T>(_ msg: T) async {
  // This odd debug info is part of a contract with CoroSplit/CoroFrame to fix
  // this up after coroutine splitting.
  // CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalF"(ptr swiftasync %0
  // CHECK-DAG: #dbg_declare(ptr %0, ![[MSG:[0-9]+]], !DIExpression({{.*}}DW_OP_plus_uconst, {{.*}}DW_OP_deref),
  // CHECK-DAG: #dbg_declare(ptr %0, ![[TAU:[0-9]+]], !DIExpression({{.*}}DW_OP_plus_uconst,

  await forceSplit()
  // CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalFTQ0_"(ptr swiftasync %0)
  // CHECK-DAG: #dbg_declare(ptr %0, ![[MSG_R:[0-9]+]], !DIExpression({{.*}}DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref),
  // CHECK-DAG: #dbg_declare(ptr %0, ![[TAU_R:[0-9]+]], !DIExpression({{.*}}DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}),
  use(msg)
}
// CHECK-LABEL: {{^define }}
@main struct Main {
  static func main() async {
    await withGenericArg("hello (asynchronously)")
  }
}
// CHECK-DAG: ![[TAU]] = !DILocalVariable(name: "$\CF\84_0_0",
// CHECK-DAG: ![[MSG]] = !DILocalVariable(name: "msg", arg: 1,
// CHECK-DAG: ![[TAU_R]] = !DILocalVariable(name: "$\CF\84_0_0",
// CHECK-DAG: ![[MSG_R]] = !DILocalVariable(name: "msg", arg: 1,



Review comment (bug):
@felipepiovezan, this line is [now failing on the 32-bit Android armv7 CI](https://ci.swift.org/job/oss-swift-package-swift-sdk-for-android/203/console), though it passes on 64-bit Android:
```
12:34:10  /source/swift-project/swift/test/DebugInfo/async-args.swift:17:12: error: CHECK: expected string not found in input
12:34:10   // CHECK: #dbg_declare(ptr %[[frame_ptr_alloca]], ![[MSG:[0-9]+]], !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 24, DW_OP_deref)
12:34:10             ^
12:34:10  <stdin>:89:23: note: scanning from here
12:34:10   %.debug = alloca ptr, align 4
12:34:10                        ^
12:34:10  <stdin>:89:23: note: with "frame_ptr_alloca" equal to ".debug"
12:34:10   %.debug = alloca ptr, align 4
12:34:10                        ^
12:34:10  <stdin>:91:2: note: possible intended match here
12:34:10   #dbg_declare(ptr %.debug, !54, !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 12, DW_OP_deref), !56)
12:34:10   ^
```
Disabling those three tests for Android armv7 in #86737, guessing they will fail on 32-bit watchOS next and will need to be modified to pass on 32-bit platforms.


Code after:
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
// RUN:    -module-name M  -target %target-swift-5.1-abi-triple \
// RUN:    -parse-as-library | %FileCheck %s

// REQUIRES: concurrency

func use<T>(_ t: T) {}
func forceSplit() async {
}
func withGenericArg<T>(_ msg: T) async {
  // This odd debug info is part of a contract with CoroSplit/CoroFrame to fix
  // this up after coroutine splitting.
  // CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalF"(
  // CHECK-SAME: ptr swiftasync %[[frame_ptr:.*]], ptr {{.*}}, ptr %[[tau:.*]])
  // CHECK-NEXT: entry:
  // CHECK-NEXT: %[[frame_ptr_alloca:.*]] = alloca ptr,
  // CHECK:      #dbg_declare(ptr %[[frame_ptr_alloca]], ![[MSG:[0-9]+]], !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 24, DW_OP_deref)
  // CHECK:      store ptr %[[frame_ptr]], ptr %[[frame_ptr_alloca]]
  // CHECK:      %[[tau_alloca:.*]] = alloca ptr,
  // CHECK-NEXT: #dbg_declare(ptr %[[tau_alloca]], ![[TAU:[0-9]+]], !DIExpression(DW_OP_deref)
  // CHECK-NEXT: store ptr %[[tau]], ptr %[[tau_alloca]]

  await forceSplit()
  // CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalFTQ0_"(ptr swiftasync %0)
  // CHECK-DAG: #dbg_declare(ptr %0, ![[MSG_R:[0-9]+]], !DIExpression({{.*}}DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref),
  // CHECK-DAG: #dbg_declare(ptr %0, ![[TAU_R:[0-9]+]], !DIExpression({{.*}}DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}),
  use(msg)
}
// CHECK-LABEL: {{^define }}
@main struct Main {
  static func main() async {
    await withGenericArg("hello (asynchronously)")
  }
}
// CHECK-DAG: ![[TAU]] = !DILocalVariable(name: "$\CF\84_0_0",
// CHECK-DAG: ![[MSG]] = !DILocalVariable(name: "msg", arg: 1,
// CHECK-DAG: ![[TAU_R]] = !DILocalVariable(name: "$\CF\84_0_0",
// CHECK-DAG: ![[MSG_R]] = !DILocalVariable(name: "msg", arg: 1,