Skip to content

Commit cbd0b15

Browse files
Merge pull request #66712 from felipepiovezan/felipe/update_debug_info_opaque_ptrs
[DebugInfo] Update tests to use opaque ptrs
2 parents 6709648 + 1ed9df0 commit cbd0b15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+339
-411
lines changed

test/DebugInfo/EagerTypeMetadata.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -Onone -emit-ir -g -o - | %FileCheck %s
2-
// RUN: %target-swift-frontend %s -Onone -emit-ir -g -o -
1+
// RUN: %target-swift-frontend %s -Onone -emit-ir -g -o - | %FileCheck %s
32

43
public class C<T>
54
{
65
func c(_ i : T)
76
{
87
// Ensure that the type metadata for T is eagerly loaded at -Onone.
98
// CHECK: define {{.*}} @"$s17EagerTypeMetadata1CC1cyyxF"
10-
// CHECK: %T = load %swift.type*, %swift.type**
9+
// CHECK: %T = load ptr, ptr
1110
// CHECK-SAME: !dbg ![[LOC:[0-9]+]], !invariant.load
1211
var x = [i]
1312
}

test/DebugInfo/LoadableByAddress-allockstack.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
// Check we don't crash when verifying debug info.
22
// Ideally this should print the output after loadable by address runs
33
// but there's no way of doing this in SIL (for IRGen passes).
4-
// RUN: %target-swift-frontend %use_no_opaque_pointers -emit-sil %s -Onone \
5-
// RUN: -sil-verify-all -Xllvm -verify-di-holes -emit-ir \
6-
// RUN: -Xllvm -sil-print-debuginfo -g -o - | %FileCheck %s
7-
84
// RUN: %target-swift-frontend -emit-sil %s -Onone \
95
// RUN: -sil-verify-all -Xllvm -verify-di-holes -emit-ir \
10-
// RUN: -Xllvm -sil-print-debuginfo -g -o -
6+
// RUN: -Xllvm -sil-print-debuginfo -g -o - | %FileCheck %s
117

128
struct m {
139
let major: Int
@@ -50,4 +46,4 @@ struct h<i>{
5046
}
5147
}
5248

53-
// CHECK: define internal %swift.opaque* @"$s4main1mVwCP"
49+
// CHECK: define internal ptr @"$s4main1mVwCP"

test/DebugInfo/ProtocolContainer.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -emit-ir -g -o - | %FileCheck %s
2-
// RUN: %target-swift-frontend %s -emit-ir -g -o -
1+
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
32

43
func markUsed<T>(_ t: T) {}
54

@@ -15,7 +14,7 @@ class AClass : AProtocol {
1514
// CHECK: define hidden {{.*}}void @"$s17ProtocolContainer3foo{{[_0-9a-zA-Z]*}}F"
1615
// CHECK-NEXT: entry:
1716
// CHECK: %[[X:.*]] = alloca %T17ProtocolContainer9AProtocolP, align {{(4|8)}}
18-
// CHECK: call void @llvm.dbg.declare(metadata %T17ProtocolContainer9AProtocolP* %[[X]], metadata ![[XMD:.*]], metadata !DIExpression())
17+
// CHECK: call void @llvm.dbg.declare(metadata ptr %[[X]], metadata ![[XMD:.*]], metadata !DIExpression())
1918
// CHECK-NOT: !DILocalVariable({{.*}} name: "x"
2019
// CHECK-NOT: !DILocalVariable({{.*}} name: "x"
2120
func foo (_ x : AProtocol) {

test/DebugInfo/WeakCapture.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -emit-ir -g -o - | %FileCheck %s
2-
// RUN: %target-swift-frontend %s -emit-ir -g -o -
1+
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
32
class A {
43
init(handler: (() -> ())) { }
54
}
@@ -11,9 +10,9 @@ func function() {
1110
let b = B()
1211

1312
// Ensure that the local b and its weak copy are distinct local variables.
14-
// CHECK: call void @llvm.dbg.{{.*}}(metadata %T11WeakCapture1BC*
13+
// CHECK: call void @llvm.dbg.{{.*}}(metadata ptr
1514
// CHECK-SAME: metadata [[B:.*]], metadata
16-
// CHECK: call void @llvm.dbg.{{.*}}(metadata %swift.weak*
15+
// CHECK: call void @llvm.dbg.{{.*}}(metadata ptr
1716
// CHECK-NOT: metadata [[B]]
1817
// CHECK: call
1918
A(handler: { [weak b] in

test/DebugInfo/any.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -emit-ir -g -o - | %FileCheck %s
2-
// RUN: %target-swift-frontend %s -emit-ir -g -o -
1+
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
32

43
func markUsed<T>(_ t: T) {}
54

65
func main() {
7-
// CHECK: call void @llvm.dbg.declare(metadata %Any* {{.*}}, metadata ![[S:.*]], metadata !DIExpression()), !dbg ![[DBG:.*]]
6+
// CHECK: define hidden swiftcc void @"$s3any4mainyyF"
7+
// CHECK: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[S:.*]], metadata !DIExpression()), !dbg ![[DBG:.*]]
88
// CHECK: ![[S]] = !DILocalVariable(name: "s", {{.*}}line: [[@LINE+2]]
99
// CHECK: ![[DBG]] = !DILocation(line: [[@LINE+1]], column: 7,
1010
var s: Any = "hello world"

test/DebugInfo/async-args.swift

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -emit-ir -g -o - \
2-
// RUN: -module-name M -disable-availability-checking \
3-
// RUN: -parse-as-library | %FileCheck %s
4-
51
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
62
// RUN: -module-name M -disable-availability-checking \
7-
// RUN: -parse-as-library
3+
// RUN: -parse-as-library | %FileCheck %s
84

95
// REQUIRES: concurrency
106

@@ -14,14 +10,14 @@ func forceSplit() async {
1410
func withGenericArg<T>(_ msg: T) async {
1511
// This odd debug info is part of a contract with CoroSplit/CoroFrame to fix
1612
// this up after coroutine splitting.
17-
// CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalF"(%swift.context* swiftasync %0
18-
// CHECK-DAG: call void @llvm.dbg.declare(metadata %swift.context* %0, metadata ![[MSG:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_plus_uconst, {{.*}}DW_OP_deref))
19-
// CHECK-DAG: call void @llvm.dbg.declare(metadata %swift.context* %0, metadata ![[TAU:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_plus_uconst,
13+
// CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalF"(ptr swiftasync %0
14+
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr %0, metadata ![[MSG:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_plus_uconst, {{.*}}DW_OP_deref))
15+
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr %0, metadata ![[TAU:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_plus_uconst,
2016

2117
await forceSplit()
22-
// CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalFTQ0_"(i8* swiftasync %0)
23-
// CHECK-DAG: call void @llvm.dbg.declare(metadata i8* %0, metadata ![[MSG_R:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_plus_uconst, [[OFFSET:[0-9]+]], DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref))
24-
// CHECK-DAG: call void @llvm.dbg.declare(metadata i8* %0, metadata ![[TAU_R:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_deref, DW_OP_plus_uconst, [[OFFSET]], DW_OP_plus_uconst, {{[0-9]+}}))
18+
// CHECK-LABEL: {{^define .*}} @"$s1M14withGenericArgyyxYalFTQ0_"(ptr swiftasync %0)
19+
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr %0, metadata ![[MSG_R:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_plus_uconst, [[OFFSET:[0-9]+]], DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref))
20+
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr %0, metadata ![[TAU_R:[0-9]+]], metadata !DIExpression({{.*}}DW_OP_deref, DW_OP_plus_uconst, [[OFFSET]], DW_OP_plus_uconst, {{[0-9]+}}))
2521
use(msg)
2622
}
2723
// CHECK-LABEL: {{^define }}

test/DebugInfo/async-let-await.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -emit-ir -g -o - \
2-
// RUN: -module-name M -disable-availability-checking \
3-
// RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
4-
51
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
62
// RUN: -module-name M -disable-availability-checking \
7-
// RUN: -parse-as-library
3+
// RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
84

95
// REQUIRES: concurrency
106

@@ -16,7 +12,7 @@ public func getVegetables() async -> [String] {
1612
public func chopVegetables() async throws -> [String] {
1713
let veggies = await getVegetables()
1814
// CHECK-NOT: {{^define }}
19-
// CHECK: call void @llvm.dbg.declare(metadata i8* %0, metadata ![[V:[0-9]+]], metadata !DIExpression(DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_plus_uconst, {{[0-9]+}})
15+
// 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]+}})
2016
// CHECK: ![[V]] = !DILocalVariable(name: "veggies"
2117
return veggies.map { "chopped \($0)" }
2218
}

test/DebugInfo/async-let.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -emit-ir -g -o - \
2-
// RUN: -module-name M -disable-availability-checking \
3-
// RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK
4-
51
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
62
// RUN: -module-name M -disable-availability-checking \
7-
// RUN: -parse-as-library
3+
// RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK
84

95
// REQUIRES: concurrency
106

117
public actor Alice {
128
let bob = Bob()
139

1410
// CHECK: define {{.*}}$s1M5AliceC4callyyYaFTY0_{{.*}} !dbg ![[SCOPE0:[0-9]+]]
15-
// CHECK: call i8* @__swift_async_resume_get_context{{.*}}!dbg ![[HOP0:[0-9]+]]
11+
// CHECK: call ptr @__swift_async_resume_get_context{{.*}}!dbg ![[HOP0:[0-9]+]]
1612

1713
// CHECK: define {{.*}}$s1M5AliceC4callyyYaFTY1_{{.*}} !dbg ![[SCOPE1:[0-9]+]]
18-
// CHECK: call i8* @__swift_async_resume_get_context{{.*}}!dbg ![[HOP1:[0-9]+]]
14+
// CHECK: call ptr @__swift_async_resume_get_context{{.*}}!dbg ![[HOP1:[0-9]+]]
1915

2016
// CHECK: define {{.*}}$s1M5AliceC4callyyYaFSiyYaYbcfu_TY0_{{.*}} !dbg ![[LET_SCOPE0:[0-9]+]]
21-
// CHECK: call i8* @__swift_async_resume_get_context{{.*}}!dbg ![[LET_HOP0:[0-9]+]]
17+
// CHECK: call ptr @__swift_async_resume_get_context{{.*}}!dbg ![[LET_HOP0:[0-9]+]]
2218

2319
// CHECK: define {{.*}}$s1M5AliceC4callyyYaFSiyYaYbcfu_TY2_{{.*}} !dbg ![[LET_SCOPE1:[0-9]+]]
24-
// CHECK: call i8* @__swift_async_resume_get_context{{.*}}!dbg ![[LET_HOP1:[0-9]+]]
20+
// CHECK: call ptr @__swift_async_resume_get_context{{.*}}!dbg ![[LET_HOP1:[0-9]+]]
2521
public func call() async {
2622
// CHECK: ![[SCOPE0]] = distinct !DISubprogram({{.*}}line: [[@LINE-1]]
2723
// CHECK: ![[HOP0]] = !DILocation(line: [[@LINE-2]], column: 15

test/DebugInfo/basic.swift

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,19 @@
2020
// CHECK-LINETABLES-NOT: DIBasicType
2121
// --------------------------------------------------------------------
2222
// Now check that we do generate line+scope info with -g.
23-
// RUN: %target-swift-frontend %use_no_opaque_pointers %/s -emit-ir -g -o - \
23+
// RUN: %target-swift-frontend %/s -emit-ir -g -o - \
2424
// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK
25-
// RUN: %target-swift-frontend %/s -emit-ir -g -o -
2625
// --------------------------------------------------------------------
2726
// Currently -gdwarf-types should give the same results as -g.
28-
// RUN: %target-swift-frontend %use_no_opaque_pointers %/s -emit-ir -gdwarf-types -o - \
27+
// RUN: %target-swift-frontend %/s -emit-ir -gdwarf-types -o - \
2928
// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK
30-
// RUN: %target-swift-frontend %/s -emit-ir -gdwarf-types -o -
3129
// --------------------------------------------------------------------
3230
// Verify that -g -debug-info-format=dwarf gives the same results as -g.
33-
// RUN: %target-swift-frontend %use_no_opaque_pointers %/s -emit-ir -g -debug-info-format=dwarf -o - \
31+
// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=dwarf -o - \
3432
// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK
35-
// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=dwarf -o -
3633
// --------------------------------------------------------------------
37-
// RUN: %target-swift-frontend %use_no_opaque_pointers %/s -emit-ir -g -debug-info-format=codeview -o - \
34+
// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=codeview -o - \
3835
// RUN: | %FileCheck %s --check-prefixes CHECK,CV-CHECK
39-
// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=codeview -o -
4036
// --------------------------------------------------------------------
4137
//
4238
// CHECK: foo
@@ -48,12 +44,12 @@ func foo(_ a: Int64, _ b: Int64) -> Int64 {
4844
var b = b
4945
// CHECK-DAG: ![[ALOC:.*]] = !DILocation(line: [[@LINE-3]],{{.*}} scope: ![[FOO]])
5046
// Check that a is the first and b is the second argument.
51-
// CHECK-DAG: store i64 %0, i64* [[AADDR:.*]], align
52-
// CHECK-DAG: store i64 %1, i64* [[BADDR:.*]], align
47+
// CHECK-DAG: store i64 %0, ptr [[AADDR:.*]], align
48+
// CHECK-DAG: store i64 %1, ptr [[BADDR:.*]], align
5349
// CHECK-DAG: [[AVAL:%.*]] = getelementptr inbounds {{.*}}, [[AMEM:.*]], i32 0, i32 0
5450
// CHECK-DAG: [[BVAL:%.*]] = getelementptr inbounds {{.*}}, [[BMEM:.*]], i32 0, i32 0
55-
// CHECK-DAG: call void @llvm.dbg.declare(metadata i64* [[AADDR]], metadata ![[AARG:.*]], metadata !DIExpression()), !dbg ![[ALOC]]
56-
// CHECK-DAG: call void @llvm.dbg.declare(metadata i64* [[BADDR]], metadata ![[BARG:.*]], metadata !DIExpression())
51+
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr [[AADDR]], metadata ![[AARG:.*]], metadata !DIExpression()), !dbg ![[ALOC]]
52+
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr [[BADDR]], metadata ![[BARG:.*]], metadata !DIExpression())
5753
// CHECK-DAG: ![[AARG]] = !DILocalVariable(name: "a", arg: 1
5854
// CHECK-DAG: ![[BARG]] = !DILocalVariable(name: "b", arg: 2
5955
if b != 0 {

test/DebugInfo/byref-capture.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers %s -emit-ir -g -o - | %FileCheck %s
2-
// RUN: %target-swift-frontend %s -emit-ir -g -o -
1+
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
32

43
func makeIncrementor(_ inc : Int64) -> () -> Int64
54
{
65
var sum : Int64 = 0
76
// CHECK: define {{.*}}5inner
87
func inner() -> Int64 {
9-
// CHECK: call void @llvm.dbg.declare(metadata %Ts5Int64V**
8+
// CHECK: call void @llvm.dbg.declare(metadata ptr
109
// CHECK-SAME: metadata ![[SUM_CAPTURE:[0-9]+]],
1110
// CHECK-SAME: metadata !DIExpression(DW_OP_deref))
1211
// CHECK: ![[INOUTTY:[0-9]+]] = !DICompositeType({{.*}}identifier: "$ss5Int64VD"

0 commit comments

Comments
 (0)