Skip to content

Commit d8e4a8f

Browse files
Jason Mittertreinerjrose-apple
authored andcommitted
Fix 2 Driver tests on Windows (swiftlang#20172)
Most of the driver tests currently don't work on Windows, but these two were relatively fixable. - Moved the dsym checks to actions-dsym and ignore that on windows - alternatively match the full path of dsymutil, which on Windows is given as "C:\....\dsymutil.exe" verify-debug-info ...
1 parent e4db036 commit d8e4a8f

File tree

3 files changed

+121
-15
lines changed

3 files changed

+121
-15
lines changed

test/Driver/actions-dsym.swift

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: touch %t/a.swiftmodule
4+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g -emit-module -module-name foo %s %t/a.swiftmodule 2>&1 | %FileCheck %s -check-prefix=SWIFTMODULE-DEBUG-INPUT
5+
// SWIFTMODULE-DEBUG-INPUT: 0: input, "{{.*}}actions-dsym.swift", swift
6+
// SWIFTMODULE-DEBUG-INPUT: 1: compile, {0}, swiftmodule
7+
// SWIFTMODULE-DEBUG-INPUT: 2: input, "{{.*}}a.swiftmodule", swift
8+
// SWIFTMODULE-DEBUG-INPUT: 3: merge-module, {1, 2}, swiftmodule
9+
10+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG
11+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gnone -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG
12+
// DEBUG: 0: input, "{{.*}}actions-dsym.swift", swift
13+
// DEBUG: 1: compile, {0}, object
14+
// DEBUG: 2: merge-module, {1}, swiftmodule
15+
// DEBUG: 3: link, {1, 2}, image
16+
// DEBUG: 4: generate-dSYM, {3}, dSYM
17+
18+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gnone %s 2>&1 | %FileCheck %s -check-prefix=BASIC
19+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g -gnone %s 2>&1 | %FileCheck %s -check-prefix=BASIC
20+
// BASIC: 0: input, "{{.*}}actions-dsym.swift", swift
21+
// BASIC: 1: compile, {0}, object
22+
// BASIC: 2: link, {1}, image
23+
24+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=DEBUG,VERIFY-DEBUG-INFO
25+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gnone -g -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=DEBUG,VERIFY-DEBUG-INFO
26+
// VERIFY-DEBUG-INFO: 5: verify-debug-info, {4}, none
27+
28+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gdwarf-types -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=EXEC-AND-MODULE,VERIFY-DEBUG-DWARF
29+
// EXEC-AND-MODULE: 0: input, "{{.*}}actions-dsym.swift", swift
30+
// EXEC-AND-MODULE: 1: compile, {0}, object
31+
// EXEC-AND-MODULE: 2: merge-module, {1}, swiftmodule
32+
// EXEC-AND-MODULE: 3: link, {1}, image
33+
// VERIFY-DEBUG-DWARF-TYPES: 4: generate-dSYM, {3}, dSYM
34+
// VERIFY-DEBUG-DWARF-TYPES: 5: verify-debug-info, {4}, none
35+
36+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gline-tables-only -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=BASIC,VERIFY-DEBUG-LINE-TABLES
37+
// VERIFY-DEBUG-LINE-TABLES-ONLY: 3: generate-dSYM, {2}, dSYM
38+
// VERIFY-DEBUG-LINE-TABLES-ONLY: 4: verify-debug-info, {3}, none
39+
40+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION
41+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION
42+
// MISSING-DEBUG-OPTION: warning: ignoring '-verify-debug-info'; no debug info is being generated
43+
// MISSING-DEBUG-OPTION: 0: input, "{{.*}}actions-dsym.swift", swift
44+
// MISSING-DEBUG-OPTION: 1: compile, {0}, object
45+
// MISSING-DEBUG-OPTION: 2: link, {1}, image
46+
47+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g -c %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-OBJECT
48+
// DEBUG-OBJECT: 0: input, "{{.*}}actions-dsym.swift", swift
49+
// DEBUG-OBJECT: 1: compile, {0}, object
50+
// DEBUG-OBJECT-NOT: merge-module
51+
52+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-MODULE
53+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gnone -g -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-MODULE
54+
// DEBUG-MODULE: 0: input, "{{.*}}actions-dsym.swift", swift
55+
// DEBUG-MODULE: 1: compile, {0}, object
56+
// DEBUG-MODULE: 2: merge-module, {1}, swiftmodule
57+
// DEBUG-MODULE: 3: link, {1, 2}, image
58+
// DEBUG-MODULE: 4: generate-dSYM, {3}, dSYM
59+
60+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -gnone -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE
61+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g -gnone -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE
62+
63+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions 2>&1 | %FileCheck %s -check-prefix=DEBUG-MULTI
64+
// DEBUG-MULTI: 0: input, "{{.*}}Inputs/main.swift", swift
65+
// DEBUG-MULTI: 1: compile, {0}, object
66+
// DEBUG-MULTI: 2: input, "{{.*}}Inputs/empty.swift", swift
67+
// DEBUG-MULTI: 3: compile, {2}, object
68+
// DEBUG-MULTI: 4: input, "{{.*}}actions-dsym.swift", swift
69+
// DEBUG-MULTI: 5: compile, {4}, object
70+
// DEBUG-MULTI: 6: merge-module, {1, 3, 5}, swiftmodule
71+
// DEBUG-MULTI: 7: link, {1, 3, 5, 6}, image
72+
// DEBUG-MULTI: 8: generate-dSYM, {7}, dSYM
73+
74+
75+
// RUN: touch %t/a.o %t/b.o
76+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %t/a.o %t/b.o -o main 2>&1 | %FileCheck %s -check-prefix=LINK-ONLY
77+
// LINK-ONLY: 0: input, "{{.*}}/a.o", object
78+
// LINK-ONLY: 1: input, "{{.*}}/b.o", object
79+
// LINK-ONLY: 2: link, {0, 1}, image
80+
81+
// RUN: touch %t/a.swiftmodule %t/b.swiftmodule
82+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %t/a.o %t/b.o %t/a.swiftmodule %t/b.swiftmodule -o main 2>&1 | %FileCheck %s -check-prefix=DEBUG-LINK-ONLY
83+
// DEBUG-LINK-ONLY: 0: input, "{{.*}}/a.o", object
84+
// DEBUG-LINK-ONLY: 1: input, "{{.*}}/b.o", object
85+
// DEBUG-LINK-ONLY: 2: input, "{{.*}}/a.swiftmodule", swiftmodule
86+
// DEBUG-LINK-ONLY: 3: input, "{{.*}}/b.swiftmodule", swiftmodule
87+
// DEBUG-LINK-ONLY: 4: link, {0, 1, 2, 3}, image
88+
// DEBUG-LINK-ONLY: 5: generate-dSYM, {4}, dSYM
89+
90+
// RUN: touch %t/c.swift
91+
// LINK-SWIFTMODULES: 0: input, "{{.*}}/c.swift", swift
92+
// LINK-SWIFTMODULES: 1: compile, {0}, object
93+
// LINK-SWIFTMODULES: 2: input, "{{.*}}/a.o", object
94+
// LINK-SWIFTMODULES: 3: input, "{{.*}}/b.o", object
95+
// LINK-SWIFTMODULES: 4: input, "{{.*}}/a.swiftmodule", swiftmodule
96+
// LINK-SWIFTMODULES: 5: input, "{{.*}}/b.swiftmodule", swiftmodule
97+
// LINK-SWIFTMODULES: 6: link, {1, 2, 3, 4, 5}, image
98+
99+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %t/c.swift %t/a.o %t/b.o %t/a.swiftmodule %t/b.swiftmodule -o main 2>&1 | %FileCheck %s -check-prefix=LINK-DEBUG-SWIFTMODULES
100+
// LINK-DEBUG-SWIFTMODULES: 0: input, "{{.*}}/c.swift", swift
101+
// LINK-DEBUG-SWIFTMODULES: 1: compile, {0}, object
102+
// LINK-DEBUG-SWIFTMODULES: 2: input, "{{.*}}/a.o", object
103+
// LINK-DEBUG-SWIFTMODULES: 3: input, "{{.*}}/b.o", object
104+
// LINK-DEBUG-SWIFTMODULES: 4: input, "{{.*}}/a.swiftmodule", swiftmodule
105+
// LINK-DEBUG-SWIFTMODULES: 5: input, "{{.*}}/b.swiftmodule", swiftmodule
106+
// LINK-DEBUG-SWIFTMODULES: 6: merge-module, {1}, swiftmodule
107+
// LINK-DEBUG-SWIFTMODULES: 7: link, {1, 2, 3, 4, 5, 6}, image
108+
109+
// RUN: touch %t/a.o %t/b.o
110+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions -force-single-frontend-invocation 2>&1 | %FileCheck %s -check-prefix=WHOLE-MODULE
111+
// WHOLE-MODULE: 0: input, "{{.*}}Inputs/main.swift", swift
112+
// WHOLE-MODULE: 1: input, "{{.*}}Inputs/empty.swift", swift
113+
// WHOLE-MODULE: 2: input, "{{.*}}actions-dsym.swift", swift
114+
// WHOLE-MODULE: 3: compile, {0, 1, 2}, object
115+
// WHOLE-MODULE: 4: link, {3}, image
116+
// WHOLE-MODULE: 5: generate-dSYM, {4}, dSYM

test/Driver/actions.swift

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,18 @@
5353
// DEBUG: 1: compile, {0}, object
5454
// DEBUG: 2: merge-module, {1}, swiftmodule
5555
// DEBUG: 3: link, {1, 2}, image
56-
// DEBUG: 4: generate-dSYM, {3}, dSYM
5756

5857
// RUN: %swiftc_driver -driver-print-actions -gnone %s 2>&1 | %FileCheck %s -check-prefix=BASIC
5958
// RUN: %swiftc_driver -driver-print-actions -g -gnone %s 2>&1 | %FileCheck %s -check-prefix=BASIC
6059

61-
// RUN: %swiftc_driver -driver-print-actions -g -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=DEBUG,VERIFY-DEBUG-INFO
62-
// RUN: %swiftc_driver -driver-print-actions -gnone -g -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=DEBUG,VERIFY-DEBUG-INFO
63-
// VERIFY-DEBUG-INFO: 5: verify-debug-info, {4}, none
60+
// RUN: %swiftc_driver -driver-print-actions -g -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=DEBUG
61+
// RUN: %swiftc_driver -driver-print-actions -gnone -g -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=DEBUG
6462

6563
// RUN: %swiftc_driver -driver-print-actions -gdwarf-types -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=EXEC-AND-MODULE,VERIFY-DEBUG-DWARF
66-
// VERIFY-DEBUG-DWARF-TYPES: 4: generate-dSYM, {3}, dSYM
67-
// VERIFY-DEBUG-DWARF-TYPES: 5: verify-debug-info, {4}, none
64+
// VERIFY-DEBUG-DWARF-TYPES: 0: verify-debug-info, {4}, none
6865

6966
// RUN: %swiftc_driver -driver-print-actions -gline-tables-only -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=BASIC,VERIFY-DEBUG-LINE-TABLES
70-
// VERIFY-DEBUG-LINE-TABLES-ONLY: 3: generate-dSYM, {2}, dSYM
71-
// VERIFY-DEBUG-LINE-TABLES-ONLY: 4: verify-debug-info, {3}, none
67+
// VERIFY-DEBUG-LINE-TABLES-ONLY: 0: verify-debug-info, {3}, none
7268

7369
// RUN: %swiftc_driver -driver-print-actions -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION
7470
// RUN: %swiftc_driver -driver-print-actions -g -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION
@@ -88,7 +84,6 @@
8884
// DEBUG-MODULE: 1: compile, {0}, object
8985
// DEBUG-MODULE: 2: merge-module, {1}, swiftmodule
9086
// DEBUG-MODULE: 3: link, {1, 2}, image
91-
// DEBUG-MODULE: 4: generate-dSYM, {3}, dSYM
9287

9388
// RUN: %swiftc_driver -driver-print-actions -gnone -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE
9489
// RUN: %swiftc_driver -driver-print-actions -g -gnone -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE
@@ -111,7 +106,6 @@
111106
// DEBUG-MULTI: 5: compile, {4}, object
112107
// DEBUG-MULTI: 6: merge-module, {1, 3, 5}, swiftmodule
113108
// DEBUG-MULTI: 7: link, {1, 3, 5, 6}, image
114-
// DEBUG-MULTI: 8: generate-dSYM, {7}, dSYM
115109

116110

117111
// RUN: touch %t/a.o %t/b.o
@@ -128,7 +122,6 @@
128122
// DEBUG-LINK-ONLY: 2: input, "{{.*}}/a.swiftmodule", swiftmodule
129123
// DEBUG-LINK-ONLY: 3: input, "{{.*}}/b.swiftmodule", swiftmodule
130124
// DEBUG-LINK-ONLY: 4: link, {0, 1, 2, 3}, image
131-
// DEBUG-LINK-ONLY: 5: generate-dSYM, {4}, dSYM
132125

133126
// RUN: touch %t/c.swift
134127
// RUN: %swiftc_driver -driver-print-actions %t/c.swift %t/a.o %t/b.o %t/a.swiftmodule %t/b.swiftmodule -o main 2>&1 | %FileCheck %s -check-prefix=LINK-SWIFTMODULES
@@ -164,6 +157,3 @@
164157
// WHOLE-MODULE: 2: input, "{{.*}}actions.swift", swift
165158
// WHOLE-MODULE: 3: compile, {0, 1, 2}, object
166159
// WHOLE-MODULE: 4: link, {3}, image
167-
168-
// RUN: %swiftc_driver -driver-print-actions -g %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions -force-single-frontend-invocation 2>&1 | %FileCheck %s -check-prefix=WHOLE-MODULE -check-prefix=WHOLE-MODULE-DEBUG
169-
// WHOLE-MODULE-DEBUG: 5: generate-dSYM, {4}, dSYM

test/Driver/verify-debug-info.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.10 -gline-tables-only -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefix=VERIFY-DEBUG-INFO
66

7-
// VERIFY-DEBUG-INFO: dsymutil verify-debug-info -o verify-debug-info.dSYM
7+
// VERIFY-DEBUG-INFO: dsymutil{{(\.exe)?}}{{"?}} verify-debug-info -o verify-debug-info.dSYM
88
// VERIFY-DEBUG-INFO: dwarfdump --verify --debug-info --eh-frame --quiet verify-debug-info.dSYM

0 commit comments

Comments
 (0)