 // LINK-DEBUG-SWIFTMODULES: 4: input, "{{.*}}/a.swiftmodule", swiftmodule
 // LINK-DEBUG-SWIFTMODULES: 5: input, "{{.*}}/b.swiftmodule", swiftmodule
 // LINK-DEBUG-SWIFTMODULES: 6: merge-module, {1}, swiftmodule
-// LINK-DEBUG-SWIFTMODULES: 7: link, {1, 2, 3, 4, 5, 6}, image
+// LINK-DEBUG-SWIFTMODULES-COFF: 7: modulewrap, {6}, object
+// LINK-DEBUG-SWIFTMODULES-COFF: 8: link, {1, 2, 3, 4, 5, 7}, image
+// LINK-DEBUG-SWIFTMODULES-ELF: 7: modulewrap, {6}, object
+// LINK-DEBUG-SWIFTMODULES-ELF: 8: link, {1, 2, 3, 4, 5, 7}, image
+// LINK-DEBUG-SWIFTMODULES-MACHO: 7: link, {1, 2, 3, 4, 5, 6}, image
 
 // RUN: touch %t/a.o %t/b.o
-// RUN: %swiftc_driver -driver-print-actions %t/a.o %s -o main 2>&1 | %FileCheck %s -check-prefix=COMPILE-PLUS-OBJECT
+// 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
 // COMPILE-PLUS-OBJECT: 0: input, "{{.*}}/a.o", object
 // COMPILE-PLUS-OBJECT: 1: input, "{{.*}}actions.swift", swift
 // COMPILE-PLUS-OBJECT: 2: compile, {1}, object
-// COMPILE-PLUS-OBJECT: 3: link, {0, 2}, image
-
-
-// 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
+// COMPILE-PLUS-OBJECT-COFF: 3: link, {0, 2}, image
+// COMPILE-PLUS-OBJECT-ELF: 3: swift-autolink-extract, {0, 2}, autolink
+// COMPILE-PLUS-OBJECT-ELF: 4: link, {0, 2, 3}, image
+// COMPILE-PLUS-OBJECT-MACHO: 3: link, {0, 2}, image
+
+
+// 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
 // WHOLE-MODULE: 0: input, "{{.*}}Inputs/main.swift", swift
 // WHOLE-MODULE: 1: input, "{{.*}}Inputs/empty.swift", swift
 // WHOLE-MODULE: 2: input, "{{.*}}actions.swift", swift
 // WHOLE-MODULE: 3: compile, {0, 1, 2}, object
-// WHOLE-MODULE: 4: link, {3}, image
+// WHOLE-MODULE-COFF: 4: link, {3}, image
+// WHOLE-MODULE-ELF: 4: swift-autolink-extract, {3}, autolink
+// WHOLE-MODULE-ELF: 5: link, {3, 4}, image
+// WHOLE-MODULE-MACHO: 4: link, {3}, image

// SWIFTMODULE-DEBUG-INPUT: 2: input, "{{.*}}a.swiftmodule", swift
// SWIFTMODULE-DEBUG-INPUT: 3: merge-module, {1, 2}, swiftmodule

// RUN: %swiftc_driver -driver-print-actions -emit-executable -emit-module %s 2>&1 | %FileCheck %s -check-prefix=EXEC-AND-MODULE
// EXEC-AND-MODULE: 0: input, "{{.*}}actions.swift", swift
// EXEC-AND-MODULE: 1: compile, {0}, object
// EXEC-AND-MODULE: 2: merge-module, {1}, swiftmodule
// EXEC-AND-MODULE: 3: link, {1}, image

// RUN: %swiftc_driver -driver-print-actions -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG
// RUN: %swiftc_driver -driver-print-actions -gnone -g %s 2>&1 | %FileCheck %s -check-prefix=DEBUG
// DEBUG: 0: input, "{{.*}}actions.swift", swift
// DEBUG: 1: compile, {0}, object
// DEBUG: 2: merge-module, {1}, swiftmodule
// DEBUG: 3: link, {1, 2}, image

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

// RUN: %empty-directory(%t)

// RUN: %swiftc_driver -driver-print-actions %s 2>&1 | %FileCheck %s -check-prefix=BASIC -check-prefix BASIC-%target-object-format
// BASIC: 0: input, "{{.*}}actions.swift", swift
// BASIC: 1: compile, {0}, object
// BASIC-COFF: 2: link, {1}, image
// BASIC-ELF: 2: swift-autolink-extract, {1}, autolink
// BASIC-ELF: 3: link, {1, 2}, image
// BASIC-MACHO: 2: link, {1}, image

// RUN: %swiftc_driver -driver-print-actions -c %s 2>&1 | %FileCheck %s -check-prefix=BASICC
// BASICC: 0: input, "{{.*}}actions.swift", swift
