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
nested_functions.swift
// RUN: %target-swift-frontend -primary-file %s -emit-ir -g -o - | %FileCheck %s

// CHECK: ![[OUTER:.*]] = distinct !DISubprogram(name: "outer",
// CHECK-SAME:                                   line: [[@LINE+1]]
func outer(_ a: Int64) -> Int64 {
     // Inner functions have a linkage name of "closure[0-9]+", but
     // their DW_AT_name is preserved.

     // CHECK: !DISubprogram(name: "inner",
     // CHECK-SAME:          scope: ![[OUTER]]
     // CHECK-SAME:          line: [[@LINE+1]]
     func inner(_ b: Int64) -> Int64 {
       return a+b
     }

     return inner(42)
}
back to top