Skip to content

Commit 8145f22

Browse files
[DebugInfo] Update tests to use opaque ptrs
1 parent 9d342f1 commit 8145f22

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

+340
-411
lines changed

test/DebugInfo/EagerTypeMetadata.swift

+2-3
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

+2-6
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

+2-3
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

+3-4
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

+3-3
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

+7-11
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

+2-6
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

+5-9
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

+8-12
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

+2-3
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"

test/DebugInfo/catch_let.swift

+5-6
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
enum MyError : Error {
54
case Yikes
@@ -17,7 +16,7 @@ public func explicitBinding() {
1716
try throwing()
1817
}
1918
catch let error {
20-
// CHECK: call void @llvm.dbg.declare(metadata %swift.error** %{{.*}}, metadata ![[EXPLICIT_ERROR:[0-9]+]],
19+
// CHECK: call void @llvm.dbg.declare(metadata ptr %{{.*}}, metadata ![[EXPLICIT_ERROR:[0-9]+]],
2120
use(error)
2221
}
2322
}
@@ -29,7 +28,7 @@ public func implicitBinding() {
2928
try throwing()
3029
}
3130
catch {
32-
// CHECK: call void @llvm.dbg.declare(metadata %swift.error** %{{.*}}, metadata ![[IMPLICIT_ERROR:[0-9]+]],
31+
// CHECK: call void @llvm.dbg.declare(metadata ptr %{{.*}}, metadata ![[IMPLICIT_ERROR:[0-9]+]],
3332
use(error)
3433
}
3534
}
@@ -41,8 +40,8 @@ public func multiBinding() {
4140
try throwing()
4241
}
4342
catch let error as MyError, let error as MyError {
44-
// CHECK: call void @llvm.dbg.declare(metadata %swift.error** %{{.*}}, metadata ![[MULTI_BINDING_ERROR:[0-9]+]],
45-
// CHECK-NOT: call void @llvm.dbg.declare(metadata %swift.error** %{{.*}}
43+
// CHECK: call void @llvm.dbg.declare(metadata ptr %{{.*}}, metadata ![[MULTI_BINDING_ERROR:[0-9]+]],
44+
// CHECK-NOT: call void @llvm.dbg.declare(metadata ptr %{{.*}}
4645
use(error)
4746
} catch {
4847
use(error)

test/DebugInfo/closure-args.swift

+7-8
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
import Swift
54

@@ -12,20 +11,20 @@ func main() -> Void
1211

1312
var backward_ptr =
1413
// CHECK: define internal {{.*}} i1 @"$s4mainAAyyFSbSS_SStcfU_"(
15-
// CHECK: %[[RANDOM_STR_ADDR:.*]] = alloca %TSS*, align {{(4|8)}}
14+
// CHECK: %[[RANDOM_STR_ADDR:.*]] = alloca ptr, align {{(4|8)}}
1615

1716
// FIXME(TODO: JIRA): i386 String is temporarily larger, and that causes the
1817
// value to be by-address. When that is fixed, remove the optional
1918
// DW_OP_deref below.
2019
//
21-
// CHECK-NEXT: call void @llvm.dbg.declare(metadata %TSS** %[[RANDOM_STR_ADDR]], metadata !{{.*}}, metadata !DIExpression({{(DW_OP_deref)?}})), !dbg
20+
// CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr %[[RANDOM_STR_ADDR]], metadata !{{.*}}, metadata !DIExpression({{(DW_OP_deref)?}})), !dbg
2221

23-
// CHECK: store %TSS* %{{.*}}, %TSS** %[[RANDOM_STR_ADDR]], align {{(4|8)}}
22+
// CHECK: store ptr %{{.*}}, ptr %[[RANDOM_STR_ADDR]], align {{(4|8)}}
2423
// CHECK-DAG: !DILocalVariable(name: "lhs",{{.*}} line: [[@LINE+5]],
2524
// CHECK-DAG: !DILocalVariable(name: "rhs",{{.*}} line: [[@LINE+4]],
26-
// CHECK-DAG: !DILocalVariable(name: "random_string",{{.*}} line: 9,
27-
// CHECK-DAG: !DILocalVariable(name: "random_int",{{.*}} line: 10,
28-
// CHECK-DAG: !DILocalVariable(name: "out_only",{{.*}} line: 11,
25+
// CHECK-DAG: !DILocalVariable(name: "random_string",{{.*}} line: 8,
26+
// CHECK-DAG: !DILocalVariable(name: "random_int",{{.*}} line: 9,
27+
// CHECK-DAG: !DILocalVariable(name: "out_only",{{.*}} line: 10,
2928
{ (lhs : String, rhs : String) -> Bool in
3029
if rhs == random_string
3130
|| rhs.unicodeScalars.count == random_int
+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
// RUN: %target-swift-frontend %use_no_opaque_pointers -g -emit-ir -Xllvm '-sil-inline-never-functions=next' %s | %FileCheck %s
2-
// RUN: %target-swift-frontend -g -emit-ir -Xllvm '-sil-inline-never-functions=next' %s
1+
// RUN: %target-swift-frontend -g -emit-ir -Xllvm '-sil-inline-never-functions=next' %s | %FileCheck %s
32

43
// FIXME: This test should be testing a non-shadow-copied value instead.
54
for i in 0 ..< 3 {
65
// CHECK: %[[ALLOCA:[0-9]+]] = alloca %TSiSg
76
// CHECK: %i.debug = alloca i{{32|64}}
8-
// CHECK-NEXT: call void @llvm.dbg.declare(metadata i{{32|64}}* %i.debug,
7+
// CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr %i.debug,
98
// CHECK-SAME: metadata ![[I:[0-9]+]],
109
// CHECK: ![[I]] = !DILocalVariable(name: "i",
1110
}

test/DebugInfo/debug_info_expression.sil

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// RUN: %target-swift-frontend %s -sil-verify-all -g -emit-sil -o - | %FileCheck --check-prefix=CHECK-SIL %s
2-
// RUN: %target-swift-frontend %use_no_opaque_pointers -disable-debugger-shadow-copies -primary-file %s -emit-ir -g -o - | %FileCheck %s
3-
// RUN: %target-swift-frontend -disable-debugger-shadow-copies -primary-file %s -emit-ir -g -o -
2+
// RUN: %target-swift-frontend -disable-debugger-shadow-copies -primary-file %s -emit-ir -g -o - | %FileCheck %s
43
import Builtin
54
import Swift
65

@@ -20,9 +19,9 @@ sil hidden @test_fragment : $@convention(thin) () -> () {
2019
bb0:
2120
%2 = alloc_stack $MyStruct, var, name "my_struct", loc "file.swift":8:9, scope 1
2221
// CHECK: %[[MY_STRUCT:.+]] = alloca %{{.*}}MyStruct
23-
// CHECK: llvm.dbg.declare(metadata {{.*}}* %[[MY_STRUCT]], metadata ![[VAR_DECL_MD:[0-9]+]]
22+
// CHECK: llvm.dbg.declare(metadata {{.*}} %[[MY_STRUCT]], metadata ![[VAR_DECL_MD:[0-9]+]]
2423
// CHECK: %[[SMALL_STRUCT:.+]] = alloca %{{.*}}SmallStruct
25-
// CHECK: llvm.dbg.declare(metadata {{.*}}* %[[SMALL_STRUCT]], metadata ![[SMALL_VAR_DECL_MD:[0-9]+]]
24+
// CHECK: llvm.dbg.declare(metadata {{.*}} %[[SMALL_STRUCT]], metadata ![[SMALL_VAR_DECL_MD:[0-9]+]]
2625
%3 = struct_element_addr %2 : $*MyStruct, #MyStruct.x, loc "file.swift":9:17, scope 1
2726
// CHECK: %[[FIELD_X:.*]] = getelementptr {{.*}} %[[MY_STRUCT]]
2827
// CHECK-SIL: debug_value %{{[0-9]+}} : $*Builtin.Int64
@@ -50,13 +49,13 @@ sil hidden @test_alloc_stack : $@convention(thin) () -> () {
5049
bb0:
5150
%my_struct = alloc_stack $MyStruct, var, name "my_struct", loc "file.swift":15:9, scope 2
5251
// CHECK: %[[MY_STRUCT:.+]] = alloca %{{.*}}MyStruct
53-
// CHECK: llvm.dbg.declare(metadata {{.*}}* %[[MY_STRUCT]], metadata ![[VAR_DECL_MD:[0-9]+]]
52+
// CHECK: llvm.dbg.declare(metadata ptr %[[MY_STRUCT]], metadata ![[VAR_DECL_MD:[0-9]+]]
5453
// CHECK-SIL: alloc_stack $Int, var
5554
// CHECK-SIL-SAME: (name "my_struct", loc "file.swift":15:9, scope {{[0-9]+}})
5655
// CHECK-SIL-SAME: type $MyStruct, expr op_fragment:#MyStruct.x
5756
%field_x = alloc_stack $Int, var, (name "my_struct", loc "file.swift":15:9, scope 2), type $MyStruct, expr op_fragment:#MyStruct.x, loc "file.swift":16:17, scope 2
5857
// CHECK: %[[FIELD_X:.+]] = alloca %TSi
59-
// CHECK: llvm.dbg.declare(metadata %TSi* %[[FIELD_X]], metadata ![[VAR_DECL_MD]]
58+
// CHECK: llvm.dbg.declare(metadata ptr %[[FIELD_X]], metadata ![[VAR_DECL_MD]]
6059
// CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 0, 64)
6160
dealloc_stack %field_x : $*Int
6261
dealloc_stack %my_struct: $*MyStruct

0 commit comments

Comments
 (0)