Skip to content

Commit 2ec9cfc

Browse files
authored
Merge pull request swiftlang#21366 from compnerd/what-is-that
test: improve DebugInfo test coverage on Windows
2 parents c4891cb + 5175ecd commit 2ec9cfc

10 files changed

+16
-15
lines changed

test/DebugInfo/Imports.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// CHECK-DAG: ![[FOOMODULE:[0-9]+]] = !DIModule({{.*}}, name: "Foo", includePath: "{{.*}}test{{.*}}DebugInfo{{.*}}"
99
// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE:[0-9]+]], entity: ![[FOOMODULE]]
10-
// CHECK-DAG: ![[THISFILE]] = !DIFile(filename: "Imports.swift", directory: "{{.*}}test/DebugInfo")
10+
// CHECK-DAG: ![[THISFILE]] = !DIFile(filename: "Imports.swift", directory: "{{.*}}test{{/|\\5C}}DebugInfo")
1111
// CHECK-DAG: ![[SWIFTFILE:[0-9]+]] = !DIFile(filename: "Swift.swiftmodule"
1212
// CHECK-DAG: ![[SWIFTMODULE:[0-9]+]] = !DIModule({{.*}}, name: "Swift"
1313
// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE]], entity: ![[SWIFTMODULE]]

test/DebugInfo/ImportsStdlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// CHECK-DAG: ![[MODULE:[0-9]+]] = !DIModule({{.*}}, name: "NotTheStdlib", includePath: "{{.*}}test{{.*}}DebugInfo{{.*}}"
1313
// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE:[0-9]+]], entity: ![[MODULE]]
14-
// CHECK-DAG: ![[THISFILE]] = !DIFile(filename: "ImportsStdlib.swift", directory: "{{.*}}test/DebugInfo")
14+
// CHECK-DAG: ![[THISFILE]] = !DIFile(filename: "ImportsStdlib.swift", directory: "{{.*}}test{{/|\\5C}}DebugInfo")
1515

1616
// NEGATIVE-NOT: !DIFile(filename: "Swift.swiftmodule"
1717
// NEGATIVE-NOT: !DIModule({{.*}}, name: "Swift"

test/DebugInfo/basic.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
// CHECK-LINETABLES-NOT: DW_TAG_basic_type
2020
// --------------------------------------------------------------------
2121
// Now check that we do generate line+scope info with -g.
22-
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
22+
// RUN: %target-swift-frontend %/s -emit-ir -g -o - \
2323
// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK
2424
// --------------------------------------------------------------------
2525
// Currently -gdwarf-types should give the same results as -g.
26-
// RUN: %target-swift-frontend %s -emit-ir -gdwarf-types -o - \
26+
// RUN: %target-swift-frontend %/s -emit-ir -gdwarf-types -o - \
2727
// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK
2828
// --------------------------------------------------------------------
2929
// Verify that -g -debug-info-format=dwarf gives the same results as -g.
30-
// RUN: %target-swift-frontend %s -emit-ir -g -debug-info-format=dwarf -o - \
30+
// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=dwarf -o - \
3131
// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK
3232
// --------------------------------------------------------------------
33-
// RUN: %target-swift-frontend %s -emit-ir -g -debug-info-format=codeview -o - \
33+
// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=codeview -o - \
3434
// RUN: | %FileCheck %s --check-prefixes CHECK,CV-CHECK
3535
// --------------------------------------------------------------------
3636
//

test/DebugInfo/compiler-flags-macosx.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Check that the sdk and resource dirs end up in the debug info if we build for
22
// a Darwin target and set the RC_DEBUG_OPTIONS environment variable. This
33
// matches the behavior found in Clang.
4+
45
// RUN: %swiftc_driver %s -emit-ir -g -target x86_64-apple-macosx10.10 -parse-stdlib -module-name scratch -o - | %FileCheck %s
5-
// RUN: RC_DEBUG_OPTIONS=1 %swiftc_driver %s -emit-ir -g -target x86_64-apple-macosx10.10 -parse-stdlib -module-name scratch -o - | %FileCheck --check-prefix CHECK-VAR-SET %s
6+
// RUN: env RC_DEBUG_OPTIONS=1 %swiftc_driver %s -emit-ir -g -target x86_64-apple-macosx10.10 -parse-stdlib -module-name scratch -o - | %FileCheck --check-prefix CHECK-VAR-SET %s
67
// CHECK: !DICompileUnit({{.*}} producer: "{{(Apple )?Swift version [^"]+}}"
78
// CHECK-NOT: flags: "
89
// CHECK-VAR-SET: !DICompileUnit({{.*}}producer: "{{(Apple )?Swift version [^"]+}}"

test/DebugInfo/compiler-flags.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Check that the sdk and resource dirs end up in the debug info if we pass the
22
// frontend flag. This tests the general functionality; we test the macosx
33
// specific toolchain logic in compiler-flags-macosx.swift.
4+
45
// RUN: %target-swiftc_driver %s -emit-ir -debug-info-store-invocation -g -o - | %FileCheck %s
56
// RUN: %target-swiftc_driver %s -emit-ir -debug-info-store-invocation -sdk "/Weird Location/SDK" -g -o - | %FileCheck --check-prefix CHECK-EXPLICIT %s
67
// CHECK: !DICompileUnit({{.*}}producer: "{{(Apple )?Swift version [^"]+}}"
@@ -15,6 +16,6 @@
1516
// CHECK-EXPLICIT-SAME: -resource-dir
1617

1718
// Check that we don't write temporary file names in the debug info
18-
// RUN: TMPDIR=abc/def %target-swift-frontend %s -I abc/def/xyz -g -emit-ir -debug-info-store-invocation -o - | %FileCheck --check-prefix CHECK-TEMP %s
19+
// RUN: env TMPDIR=abc/def %target-swift-frontend %s -I abc/def/xyz -g -emit-ir -debug-info-store-invocation -o - | %FileCheck --check-prefix CHECK-TEMP %s
1920
// CHECK-TEMP: !DICompileUnit({{.*}} flags: "{{.*}} -I <temporary-file>
2021

test/DebugInfo/debug_prefix_map.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swiftc_driver -g -debug-prefix-map %S=/var/empty %s -emit-ir -o - | %FileCheck %s
1+
// RUN: %swiftc_driver -g -debug-prefix-map %/S=/var/empty %/s -emit-ir -o - | %FileCheck %s
22

33
func square(_ n: Int) -> Int {
44
return n * n

test/DebugInfo/inlinescopes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: %FileCheck %s < %t.ll
66
// RUN: %FileCheck %s -check-prefix=TRANSPARENT-CHECK < %t.ll
77

8-
// CHECK: define{{( protected)?( signext)?}} i32 @main
8+
// CHECK: define{{( dllexport)?}}{{( protected)?( signext)?}} i32 @main
99
// CHECK: call {{.*}}noinline{{.*}}, !dbg ![[CALL:.*]]
1010
// CHECK-DAG: ![[TOPLEVEL:.*]] = !DIFile(filename: "inlinescopes.swift"
1111

test/DebugInfo/prologue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ func bar<T, U>(_ x: T, y: U) { markUsed("bar") }
1212
// prologue and the beginning of the function body.
1313
// CHECK-NOT: callq *
1414
// CHECK: .loc [[F]] [[@LINE-6]] {{.}}
15-
// CHECK: callq {{.*}}builtinStringLiteral
15+
// CHECK: {{callq .*builtinStringLiteral|movq __imp_.*builtinStringLiteral}}

test/DebugInfo/top_level_code.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// RUN: %target-swift-frontend %s -S -g -o - | %FileCheck %s
22

3-
// XFAIL: linux
4-
53
func markUsed<T>(_ t: T) {}
6-
// CHECK: _main:
4+
// CHECK: {{_?}}main:
75
// CHECK-NEXT: Lfunc_begin0:
86
// Verify that the top-level function (main) begins at line 0 and then
97
// proceeds to the first line.
10-
// CHECK: .loc {{[0-9]}} 0 {{[0-9]}}
8+
// CHECK: .loc {{[0-9]}} 0 {{[0-9]}}
119
// CHECK-NOT: Lfunc_end0:
1210
// CHECK: .loc {{[0-9]}} [[@LINE+1]] {{[0-9]}} prologue_end
1311
var a = 1

test/DebugInfo/variables.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// RUN: %target-swift-frontend %s -g -S -o - | %FileCheck %s --check-prefix ASM-%target-object-format
55
// ASM-macho: .section __DWARF,__debug_info
66
// ASM-elf: .section .debug_info,"",{{[@%]}}progbits
7+
// ASM-coff: .section .debug_info,"dr"
78

89
// Test variables-interpreter.swift runs this code with `swift -g -i`.
910
// Test variables-repl.swift runs this code with `swift -g < variables.swift`.

0 commit comments

Comments
 (0)