Skip to content

Commit 475f779

Browse files
committed
Add a test for nested macro debug info
rdar://105997826
1 parent ff5c531 commit 475f779

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
@@ -101,11 +101,19 @@ func testFileID(a: Int, b: Int) {
101101
// CHECK-SIL: sil_scope [[EXPANSION_SCOPE:[0-9]+]] { loc "{{.*}}macro_expand.swift":[[@LINE-2]]:22 parent [[SRC_SCOPE]]
102102
// CHECK-SIL: sil_scope [[MACRO_SCOPE:[0-9]+]] { loc "{{.*}}":[[@LINE-3]]:22 parent @$s9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_ {{.*}} inlined_at [[EXPANSION_SCOPE]] }
103103
// CHECK-SIL: string_literal utf8 "MacroUser/macro_expand.swift", loc "@__swiftmacro_9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_.swift":1:1, scope [[MACRO_SCOPE]]
104-
// CHECK-IR: !DISubprogram(name: "customFileID", linkageName: "$s9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_"
104+
// CHECK-IR-DAG: !DISubprogram(name: "customFileID", linkageName: "$s9MacroUser10testFileID1a1bySi_SitF06customdE0fMf_"
105105

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

111119
testFileID(a: 1, b: 2)

0 commit comments

Comments
 (0)