|
1 | 1 | // RUN: %empty-directory(%t)
|
2 | 2 |
|
3 |
| -// XFAIL: freebsd, linux |
4 |
| - |
5 |
| -// RUN: %swiftc_driver -driver-print-actions %s 2>&1 | %FileCheck %s -check-prefix=BASIC |
| 3 | +// RUN: %swiftc_driver -driver-print-actions %s 2>&1 | %FileCheck %s -check-prefix=BASIC -check-prefix BASIC-%target-object-format |
6 | 4 | // BASIC: 0: input, "{{.*}}actions.swift", swift
|
7 | 5 | // BASIC: 1: compile, {0}, object
|
8 |
| -// BASIC: 2: link, {1}, image |
| 6 | +// BASIC-COFF: 2: link, {1}, image |
| 7 | +// BASIC-ELF: 2: swift-autolink-extract, {1}, autolink |
| 8 | +// BASIC-ELF: 3: link, {1, 2}, image |
| 9 | +// BASIC-MACHO: 2: link, {1}, image |
9 | 10 |
|
10 | 11 | // RUN: %swiftc_driver -driver-print-actions -c %s 2>&1 | %FileCheck %s -check-prefix=BASICC
|
11 | 12 | // BASICC: 0: input, "{{.*}}actions.swift", swift
|
|
45 | 46 | // SWIFTMODULE-DEBUG-INPUT: 2: input, "{{.*}}a.swiftmodule", swift
|
46 | 47 | // SWIFTMODULE-DEBUG-INPUT: 3: merge-module, {1, 2}, swiftmodule
|
47 | 48 |
|
48 |
| -// RUN: %swiftc_driver -driver-print-actions -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE |
| 49 | +// RUN: %swiftc_driver -driver-print-actions -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE -check-prefix EXEC-AND-MODULE-%target-object-format |
49 | 50 | // EXEC-AND-MODULE: 0: input, "{{.*}}actions.swift", swift
|
50 | 51 | // EXEC-AND-MODULE: 1: compile, {0}, object
|
51 | 52 | // EXEC-AND-MODULE: 2: merge-module, {1}, swiftmodule
|
52 |
| -// EXEC-AND-MODULE: 3: link, {1}, image |
| 53 | +// EXEC-AND-MODULE-COFF: 3: link, {1}, image |
| 54 | +// EXEC-AND-MODULE-ELF: 3: swift-autolink-extract, {1}, autolink |
| 55 | +// EXEC-AND-MODULE-ELF: 4: link, {1, 3}, image |
| 56 | +// EXEC-AND-MODULE-MACHO: 3: link, {1}, image |
53 | 57 |
|
54 |
| -// RUN: %swiftc_driver -driver-print-actions -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG |
55 |
| -// RUN: %swiftc_driver -driver-print-actions -gnone -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG |
| 58 | +// RUN: %swiftc_driver -driver-print-actions -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG -check-prefix DEBUG-%target-object-format |
| 59 | +// RUN: %swiftc_driver -driver-print-actions -gnone -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG -check-prefix DEBUG-%target-object-format |
56 | 60 | // DEBUG: 0: input, "{{.*}}actions.swift", swift
|
57 | 61 | // DEBUG: 1: compile, {0}, object
|
58 | 62 | // DEBUG: 2: merge-module, {1}, swiftmodule
|
59 |
| -// DEBUG: 3: link, {1, 2}, image |
| 63 | +// DEBUG-COFF: 3: modulewrap, {2}, object |
| 64 | +// DEBUG-COFF: 4: line, {1, 3}, image |
| 65 | +// DEBUG-ELF: 3: modulewrap, {2}, object |
| 66 | +// DEBUG-ELF: 4: line, {1, 3}, image |
| 67 | +// DEBUG-MACHO: 3: link, {1, 2}, image |
60 | 68 |
|
61 | 69 | // RUN: %swiftc_driver -driver-print-actions -gnone %s 2>&1 | %FileCheck %s -check-prefix=BASIC
|
62 | 70 | // RUN: %swiftc_driver -driver-print-actions -g -gnone %s 2>&1 | %FileCheck %s -check-prefix=BASIC
|
|
70 | 78 | // RUN: %swiftc_driver -driver-print-actions -gline-tables-only -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=BASIC,VERIFY-DEBUG-LINE-TABLES
|
71 | 79 | // VERIFY-DEBUG-LINE-TABLES-ONLY: 0: verify-debug-info, {3}, none
|
72 | 80 |
|
73 |
| -// RUN: %swiftc_driver -driver-print-actions -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION |
74 |
| -// RUN: %swiftc_driver -driver-print-actions -g -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION |
| 81 | +// RUN: %swiftc_driver -driver-print-actions -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION -check-prefix MISSING-DEBUG-%target-object-format |
| 82 | +// RUN: %swiftc_driver -driver-print-actions -g -gnone -verify-debug-info %s 2>&1 | %FileCheck %s -check-prefixes=MISSING-DEBUG-OPTION -check-prefix MISSING-DEBUG-%target-object-format |
75 | 83 | // MISSING-DEBUG-OPTION: warning: ignoring '-verify-debug-info'; no debug info is being generated
|
76 | 84 | // MISSING-DEBUG-OPTION: 0: input, "{{.*}}actions.swift", swift
|
77 | 85 | // MISSING-DEBUG-OPTION: 1: compile, {0}, object
|
78 |
| -// MISSING-DEBUG-OPTION: 2: link, {1}, image |
| 86 | +// MISSING-DEBUG-OPTION-COFF: 2: link, {1}, image |
| 87 | +// MISSING-DEBUG-OPTION-ELF: 2: swift-autolink-extract, {1}, autolink |
| 88 | +// MISSING-DEBUG-OPTION-ELF: 3: link, {1, 2}, image |
| 89 | +// MISSING-DEBUG-OPTION-MACHO: 2: link, {1}, image |
79 | 90 |
|
80 | 91 | // RUN: %swiftc_driver -driver-print-actions -g -c %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-OBJECT
|
81 | 92 | // DEBUG-OBJECT: 0: input, "{{.*}}actions.swift", swift
|
82 | 93 | // DEBUG-OBJECT: 1: compile, {0}, object
|
83 | 94 | // DEBUG-OBJECT-NOT: merge-module
|
84 | 95 |
|
85 |
| -// RUN: %swiftc_driver -driver-print-actions -g -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-MODULE |
86 |
| -// RUN: %swiftc_driver -driver-print-actions -gnone -g -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-MODULE |
| 96 | +// RUN: %swiftc_driver -driver-print-actions -g -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-MODULE -check-prefix DEBUG-MODULE-%target-object-format |
| 97 | +// RUN: %swiftc_driver -driver-print-actions -gnone -g -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=DEBUG-MODULE -check-prefix DEBUG-MODULE-%target-object-format |
87 | 98 | // DEBUG-MODULE: 0: input, "{{.*}}actions.swift", swift
|
88 | 99 | // DEBUG-MODULE: 1: compile, {0}, object
|
89 | 100 | // DEBUG-MODULE: 2: merge-module, {1}, swiftmodule
|
90 |
| -// DEBUG-MODULE: 3: link, {1, 2}, image |
| 101 | +// DEBUG-MODULE-COFF: 3: modulewrap, {2}, object |
| 102 | +// DEBUG-MODULE-COFF: 4: link, {1, 3}, image |
| 103 | +// DEBUG-MODULE-ELF: 3: modulewrap, {2}, object |
| 104 | +// DEBUG-MODULE-ELF: 4: link, {1, 3}, image |
| 105 | +// DEBUG-MODULE-MACHO: 3: link, {1, 2}, image |
91 | 106 |
|
92 | 107 | // RUN: %swiftc_driver -driver-print-actions -gnone -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE
|
93 | 108 | // RUN: %swiftc_driver -driver-print-actions -g -gnone -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE
|
94 | 109 |
|
95 |
| -// RUN: %swiftc_driver -driver-print-actions %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions 2>&1 | %FileCheck %s -check-prefix=MULTI |
| 110 | +// RUN: %swiftc_driver -driver-print-actions %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions 2>&1 | %FileCheck %s -check-prefix=MULTI -check-prefix MULTI-%target-object-format |
96 | 111 | // MULTI: 0: input, "{{.*}}Inputs/main.swift", swift
|
97 | 112 | // MULTI: 1: compile, {0}, object
|
98 | 113 | // MULTI: 2: input, "{{.*}}Inputs/empty.swift", swift
|
99 | 114 | // MULTI: 3: compile, {2}, object
|
100 | 115 | // MULTI: 4: input, "{{.*}}actions.swift", swift
|
101 | 116 | // MULTI: 5: compile, {4}, object
|
102 |
| -// MULTI: 6: link, {1, 3, 5}, image |
| 117 | +// MULTI-COFF: 6: link, {1, 3, 5}, image |
| 118 | +// MULTI-ELF: 6: swift-autolink-extract, {1, 3, 5}, autolink |
| 119 | +// MULTI-ELF: 7: link, {1, 3, 5, 6}, image |
| 120 | +// MULTI-MACHO: 6: link, {1, 3, 5}, image |
103 | 121 |
|
104 |
| -// RUN: %swiftc_driver -driver-print-actions -g %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions 2>&1 | %FileCheck %s -check-prefix=DEBUG-MULTI |
| 122 | +// RUN: %swiftc_driver -driver-print-actions -g %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions 2>&1 | %FileCheck %s -check-prefix=DEBUG-MULTI -check-prefix DEBUG-MULTI-%target-object-format |
105 | 123 | // DEBUG-MULTI: 0: input, "{{.*}}Inputs/main.swift", swift
|
106 | 124 | // DEBUG-MULTI: 1: compile, {0}, object
|
107 | 125 | // DEBUG-MULTI: 2: input, "{{.*}}Inputs/empty.swift", swift
|
108 | 126 | // DEBUG-MULTI: 3: compile, {2}, object
|
109 | 127 | // DEBUG-MULTI: 4: input, "{{.*}}actions.swift", swift
|
110 | 128 | // DEBUG-MULTI: 5: compile, {4}, object
|
111 | 129 | // DEBUG-MULTI: 6: merge-module, {1, 3, 5}, swiftmodule
|
112 |
| -// DEBUG-MULTI: 7: link, {1, 3, 5, 6}, image |
| 130 | +// DEBUG-MULTI-COFF: 7: modulewrap, {6}, object |
| 131 | +// DEBUG-MULTI-COFF: 8: link, {1, 3, 5, 7}, image |
| 132 | +// DEBUG-MULTI-ELF: 7: modulewrap, {6}, object |
| 133 | +// DEBUG-MULTI-ELF: 8: link, {1, 3, 5, 7}, image |
| 134 | +// DEBUG-MULTI-MACHO: 7: link, {1, 3, 5, 6}, image |
113 | 135 |
|
114 | 136 |
|
115 | 137 | // RUN: touch %t/a.o %t/b.o
|
116 |
| -// RUN: %swiftc_driver -driver-print-actions %t/a.o %t/b.o -o main 2>&1 | %FileCheck %s -check-prefix=LINK-ONLY |
117 |
| -// RUN: %swiftc_driver -driver-print-actions -g %t/a.o %t/b.o -o main 2>&1 | %FileCheck %s -check-prefix=LINK-ONLY |
| 138 | +// RUN: %swiftc_driver -driver-print-actions %t/a.o %t/b.o -o main 2>&1 | %FileCheck %s -check-prefix=LINK-ONLY -check-prefix LINK-ONLY-%target-object-format |
| 139 | +// RUN: %swiftc_driver -driver-print-actions -g %t/a.o %t/b.o -o main 2>&1 | %FileCheck %s -check-prefix=LINK-ONLY -check-prefix LINK-ONLY-%target-object-format |
118 | 140 | // LINK-ONLY: 0: input, "{{.*}}/a.o", object
|
119 | 141 | // LINK-ONLY: 1: input, "{{.*}}/b.o", object
|
120 |
| -// LINK-ONLY: 2: link, {0, 1}, image |
| 142 | +// LINK-ONLY-COFF: 2: link, {0, 1}, image |
| 143 | +// LINK-ONLY-ELF: 2: swift-autolink-extract, {0, 1}, autolink |
| 144 | +// LINK-ONLY-ELF: 3: link, {0, 1, 2}, image |
| 145 | +// LINK-ONLY-MACHO: 2: link, {0, 1}, image |
121 | 146 |
|
122 | 147 | // RUN: touch %t/a.swiftmodule %t/b.swiftmodule
|
123 |
| -// RUN: %swiftc_driver -driver-print-actions -g %t/a.o %t/b.o %t/a.swiftmodule %t/b.swiftmodule -o main 2>&1 | %FileCheck %s -check-prefix=DEBUG-LINK-ONLY |
| 148 | +// RUN: %swiftc_driver -driver-print-actions -g %t/a.o %t/b.o %t/a.swiftmodule %t/b.swiftmodule -o main 2>&1 | %FileCheck %s -check-prefix=DEBUG-LINK-ONLY -check-prefix DEBUG-LINK-ONLY-%target-object-format |
124 | 149 | // DEBUG-LINK-ONLY: 0: input, "{{.*}}/a.o", object
|
125 | 150 | // DEBUG-LINK-ONLY: 1: input, "{{.*}}/b.o", object
|
126 | 151 | // DEBUG-LINK-ONLY: 2: input, "{{.*}}/a.swiftmodule", swiftmodule
|
127 | 152 | // DEBUG-LINK-ONLY: 3: input, "{{.*}}/b.swiftmodule", swiftmodule
|
128 |
| -// DEBUG-LINK-ONLY: 4: link, {0, 1, 2, 3}, image |
| 153 | +// DEBUG-LINK-ONLY-COFF: 4: link, {0, 1, 2, 3}, image |
| 154 | +// DEBUG-LINK-ONLY-ELF: 4: swift-autolink-extract, {0, 1, 2, 3}, autolink |
| 155 | +// DEBUG-LINK-ONLY-ELF: 4: link, {0, 1, 2, 3, 4}, image |
| 156 | +// DEBUG-LINK-ONLY-MACHO: 4: link, {0, 1, 2, 3}, image |
129 | 157 |
|
130 | 158 | // RUN: touch %t/c.swift
|
131 |
| -// 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 |
| 159 | +// 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 -check-prefix LINK-SWIFTMODULES-%target-object-format |
132 | 160 | // LINK-SWIFTMODULES: 0: input, "{{.*}}/c.swift", swift
|
133 | 161 | // LINK-SWIFTMODULES: 1: compile, {0}, object
|
134 | 162 | // LINK-SWIFTMODULES: 2: input, "{{.*}}/a.o", object
|
135 | 163 | // LINK-SWIFTMODULES: 3: input, "{{.*}}/b.o", object
|
136 | 164 | // LINK-SWIFTMODULES: 4: input, "{{.*}}/a.swiftmodule", swiftmodule
|
137 | 165 | // LINK-SWIFTMODULES: 5: input, "{{.*}}/b.swiftmodule", swiftmodule
|
138 |
| -// LINK-SWIFTMODULES: 6: link, {1, 2, 3, 4, 5}, image |
| 166 | +// LINK-SWIFTMODULES-COFF: 6: link, {1, 2, 3, 4, 5}, image |
| 167 | +// LINK-SWIFTMODULES-ELF: 6: swift-autolink-extract, {1, 2, 3, 4, 5}, autolink |
| 168 | +// LINK-SWIFTMODULES-ELF: 6: link, {1, 2, 3, 4, 5, 6}, image |
| 169 | +// LINK-SWIFTMODULES-MACHO: 6: link, {1, 2, 3, 4, 5}, image |
139 | 170 |
|
140 |
| -// RUN: %swiftc_driver -driver-print-actions -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 |
| 171 | +// RUN: %swiftc_driver -driver-print-actions -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 -check-prefix LINK-DEBUG-SWIFTMODULES-%target-object-format |
141 | 172 | // LINK-DEBUG-SWIFTMODULES: 0: input, "{{.*}}/c.swift", swift
|
142 | 173 | // LINK-DEBUG-SWIFTMODULES: 1: compile, {0}, object
|
143 | 174 | // LINK-DEBUG-SWIFTMODULES: 2: input, "{{.*}}/a.o", object
|
144 | 175 | // LINK-DEBUG-SWIFTMODULES: 3: input, "{{.*}}/b.o", object
|
145 | 176 | // LINK-DEBUG-SWIFTMODULES: 4: input, "{{.*}}/a.swiftmodule", swiftmodule
|
146 | 177 | // LINK-DEBUG-SWIFTMODULES: 5: input, "{{.*}}/b.swiftmodule", swiftmodule
|
147 | 178 | // LINK-DEBUG-SWIFTMODULES: 6: merge-module, {1}, swiftmodule
|
148 |
| -// LINK-DEBUG-SWIFTMODULES: 7: link, {1, 2, 3, 4, 5, 6}, image |
| 179 | +// LINK-DEBUG-SWIFTMODULES-COFF: 7: modulewrap, {6}, object |
| 180 | +// LINK-DEBUG-SWIFTMODULES-COFF: 8: link, {1, 2, 3, 4, 5, 7}, image |
| 181 | +// LINK-DEBUG-SWIFTMODULES-ELF: 7: modulewrap, {6}, object |
| 182 | +// LINK-DEBUG-SWIFTMODULES-ELF: 8: link, {1, 2, 3, 4, 5, 7}, image |
| 183 | +// LINK-DEBUG-SWIFTMODULES-MACHO: 7: link, {1, 2, 3, 4, 5, 6}, image |
149 | 184 |
|
150 | 185 | // RUN: touch %t/a.o %t/b.o
|
151 |
| -// RUN: %swiftc_driver -driver-print-actions %t/a.o %s -o main 2>&1 | %FileCheck %s -check-prefix=COMPILE-PLUS-OBJECT |
| 186 | +// RUN: %swiftc_driver -driver-print-actions %t/a.o %s -o main 2>&1 | %FileCheck %s -check-prefix=COMPILE-PLUS-OBJECT -check-prefix COMPILE-PLUS-OBJECT-%target-object-format |
152 | 187 | // COMPILE-PLUS-OBJECT: 0: input, "{{.*}}/a.o", object
|
153 | 188 | // COMPILE-PLUS-OBJECT: 1: input, "{{.*}}actions.swift", swift
|
154 | 189 | // COMPILE-PLUS-OBJECT: 2: compile, {1}, object
|
155 |
| -// COMPILE-PLUS-OBJECT: 3: link, {0, 2}, image |
| 190 | +// COMPILE-PLUS-OBJECT-COFF: 3: link, {0, 2}, image |
| 191 | +// COMPILE-PLUS-OBJECT-ELF: 3: swift-autolink-extract, {0, 2}, autolink |
| 192 | +// COMPILE-PLUS-OBJECT-ELF: 4: link, {0, 2, 3}, image |
| 193 | +// COMPILE-PLUS-OBJECT-MACHO: 3: link, {0, 2}, image |
156 | 194 |
|
157 | 195 |
|
158 |
| -// RUN: %swiftc_driver -driver-print-actions %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions -force-single-frontend-invocation 2>&1 | %FileCheck %s -check-prefix=WHOLE-MODULE |
| 196 | +// RUN: %swiftc_driver -driver-print-actions %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-%target-object-format |
159 | 197 | // WHOLE-MODULE: 0: input, "{{.*}}Inputs/main.swift", swift
|
160 | 198 | // WHOLE-MODULE: 1: input, "{{.*}}Inputs/empty.swift", swift
|
161 | 199 | // WHOLE-MODULE: 2: input, "{{.*}}actions.swift", swift
|
162 | 200 | // WHOLE-MODULE: 3: compile, {0, 1, 2}, object
|
163 |
| -// WHOLE-MODULE: 4: link, {3}, image |
| 201 | +// WHOLE-MODULE-COFF: 4: link, {3}, image |
| 202 | +// WHOLE-MODULE-ELF: 4: swift-autolink-extract, {3}, autolink |
| 203 | +// WHOLE-MODULE-ELF: 5: link, {3, 4}, image |
| 204 | +// WHOLE-MODULE-MACHO: 4: link, {3}, image |
0 commit comments