Skip to content

Commit 5fe0f42

Browse files
committed
Add a test for nested macro debug info
rdar://105997826 (cherry picked from commit 475f779)
1 parent 712ef2c commit 5fe0f42

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/Macros/macro_expand.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,19 @@ func testFileID(a: Int, b: Int) {
102102
// CHECK-SIL: sil_scope [[EXPANSION_SCOPE:[0-9]+]] { loc "{{.*}}macro_expand.swift":[[@LINE-2]]:22 parent [[SRC_SCOPE]]
103103
// CHECK-SIL: sil_scope [[MACRO_SCOPE:[0-9]+]] { loc "{{.*}}":[[@LINE-3]]:22 parent @$s9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_ {{.*}} inlined_at [[EXPANSION_SCOPE]] }
104104
// CHECK-SIL: string_literal utf8 "MacroUser/macro_expand.swift", loc "@__swiftmacro_9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_.swift":1:1, scope [[MACRO_SCOPE]]
105-
// CHECK-IR: !DISubprogram(name: "customFileID", linkageName: "$s9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_"
105+
// CHECK-IR-DAG: !DISubprogram(name: "customFileID", linkageName: "$s9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_"
106106

107107
// CHECK: Builtin result is MacroUser/macro_expand.swift
108108
// CHECK-AST: macro_expansion_expr type='String'{{.*}}name=line
109109
print("Builtin result is \(#fileID)")
110+
print(
111+
/// CHECK-IR-DAG: ![[L1:[0-9]+]] = !DILocation(line: [[@LINE+1]], column: 5
112+
#addBlocker(
113+
/// CHECK-IR-DAG: ![[L2:[0-9]+]] = !DILocation({{.*}}inlinedAt: ![[L1]])
114+
/// CHECK-IR-DAG: ![[L3:[0-9]+]] = !DILocation({{.*}}inlinedAt: ![[L2]])
115+
#stringify(a - b)
116+
)
117+
)
110118
}
111119

112120
testFileID(a: 1, b: 2)

0 commit comments

Comments
 (0)